We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4315c2a commit afdbf00Copy full SHA for afdbf00
src/services/codefixes/fixSpelling.ts
@@ -15,7 +15,8 @@ namespace ts.codefix {
15
const node = getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); // TODO: GH#15852
16
const checker = context.program.getTypeChecker();
17
let suggestion: string;
18
- if (node.kind === SyntaxKind.Identifier && isPropertyAccessExpression(node.parent)) {
+ if (isPropertyAccessExpression(node.parent) && node.parent.name === node) {
19
+ Debug.assert(node.kind === SyntaxKind.Identifier);
20
const containingType = checker.getTypeAtLocation(node.parent.expression);
21
suggestion = checker.getSuggestionForNonexistentProperty(node as Identifier, containingType);
22
}
0 commit comments