Quick fix to correct qualified names to indexed access types#17462
Merged
DanielRosenwasser merged 5 commits intomasterfrom Jul 27, 2017
Merged
Quick fix to correct qualified names to indexed access types#17462DanielRosenwasser merged 5 commits intomasterfrom
DanielRosenwasser merged 5 commits intomasterfrom
Conversation
weswigham
approved these changes
Jul 27, 2017
aozgaa
approved these changes
Jul 27, 2017
Contributor
aozgaa
left a comment
There was a problem hiding this comment.
Not sure you want to make changes to get the fix working in the case mentioned below, but please add a test.
| const token = getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); | ||
| const qualifiedName = getAncestor(token, SyntaxKind.QualifiedName) as QualifiedName; | ||
| Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name."); | ||
| if (!isIdentifier(qualifiedName.left)) { |
Contributor
There was a problem hiding this comment.
This example doesn't seem to trigger the right error, though we can apply the fix manually to fix the issue:
module M {
export interface I {
foo: string;
}
}
let a: M.I.foo;
Please add a test.
| @@ -1,3 +1,4 @@ | |||
| /// <reference path="correctQualifiedNameToIndexedAccessType.ts" /> | |||
| /// <reference path="fixClassIncorrectlyImplementsInterface.ts" /> | |||
Contributor
There was a problem hiding this comment.
Looks like there is an analogous entry to this in src/harness/tsconfig.json. Not sure why it's there, or if we might want to remove it. Or alternatively, add a reference to correctQualifiedNameToIndexedAccessType.ts.
@weswigham do you know if building for tests will correctly trigger a rebuild when we make changes to correctQualifiedNameToIndexedAccessType.ts?
Member
Author
…e already referenced in 'src/harness/codefixes/fixes.ts'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #17461