-
Notifications
You must be signed in to change notification settings - Fork 12.8k
add code fix convert to mapped object type #24286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
some formatting issue with #24312 |
@Andy-MS can you please review this change. |
|
||
function getFixableSignatureAtPosition(sourceFile: SourceFile, pos: number): Info | undefined { | ||
const token = getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); | ||
if (!isIndexSignatureParameterName(token)) return undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that microsoft/vscode#45785 is fixed, might as well just assert these things as you go, which could save you some casts.
The only time this shouldn't be fixable is in a class, right? So in getCodeActions
, all we should need to determine whether it's fixable is whether token.parent.parent.parent
is a class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, in my memory, i have not to use assert or cast (almost) 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after thinking and search, This may exceed my expectations 😢
e6ebb58
to
7f4aeee
Compare
Thanks! |
Can this be merged into 2.9 or 2.9.1? It'd be nice to have in 2.9 to line up with the current release notes which make me expect that this would be supported. |
No, this will be available in TypeScript 3.0 in two month, or in |
Fixes #24220