@@ -13245,7 +13245,7 @@ namespace ts {
13245
13245
}
13246
13246
else {
13247
13247
let suggestion: string | undefined;
13248
- if (propName !== undefined && (suggestion = getSuggestionForNonexistentProperty(propName as string, objectType))) {
13248
+ if (propName !== undefined && (suggestion = getSuggestionForNonexistentProperty(propName as string, objectType, false ))) {
13249
13249
if (suggestion !== undefined) {
13250
13250
error(accessExpression.argumentExpression, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName as string, typeToString(objectType), suggestion);
13251
13251
}
@@ -16335,7 +16335,7 @@ namespace ts {
16335
16335
16336
16336
const name = propDeclaration.name!;
16337
16337
if (isIdentifier(name)) {
16338
- suggestion = getSuggestionForNonexistentProperty(name, errorTarget);
16338
+ suggestion = getSuggestionForNonexistentProperty(name, errorTarget, false );
16339
16339
}
16340
16340
}
16341
16341
if (suggestion !== undefined) {
@@ -24852,7 +24852,7 @@ namespace ts {
24852
24852
relatedInfo = createDiagnosticForNode(propNode, Diagnostics.Did_you_forget_to_use_await);
24853
24853
}
24854
24854
else {
24855
- const suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType);
24855
+ const suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType, false );
24856
24856
if (suggestion !== undefined) {
24857
24857
const suggestedName = symbolName(suggestion);
24858
24858
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, declarationNameToString(propNode), typeToString(containingType), suggestedName);
@@ -24875,12 +24875,12 @@ namespace ts {
24875
24875
return prop !== undefined && prop.valueDeclaration && hasSyntacticModifier(prop.valueDeclaration, ModifierFlags.Static);
24876
24876
}
24877
24877
24878
- function getSuggestedSymbolForNonexistentProperty(name: Identifier | PrivateIdentifier | string, containingType: Type, isJSX = false ): Symbol | undefined {
24879
- return getSpellingSuggestionForName(isString(name) ? name : idText(name), getPropertiesOfType(containingType), SymbolFlags.Value, isJSX );
24878
+ function getSuggestedSymbolForNonexistentProperty(name: Identifier | PrivateIdentifier | string, containingType: Type, isJsxAttr: boolean ): Symbol | undefined {
24879
+ return getSpellingSuggestionForName(isString(name) ? name : idText(name), getPropertiesOfType(containingType), SymbolFlags.Value, isJsxAttr );
24880
24880
}
24881
24881
24882
- function getSuggestionForNonexistentProperty(name: Identifier | PrivateIdentifier | string, containingType: Type, isJSX = false ): string | undefined {
24883
- const suggestion = getSuggestedSymbolForNonexistentProperty(name, containingType, isJSX );
24882
+ function getSuggestionForNonexistentProperty(name: Identifier | PrivateIdentifier | string, containingType: Type, isJsxAttr: boolean ): string | undefined {
24883
+ const suggestion = getSuggestedSymbolForNonexistentProperty(name, containingType, isJsxAttr );
24884
24884
return suggestion && symbolName(suggestion);
24885
24885
}
24886
24886
@@ -24892,7 +24892,7 @@ namespace ts {
24892
24892
// Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function
24893
24893
// So the table *contains* `x` but `x` isn't actually in scope.
24894
24894
// However, resolveNameHelper will continue and call this callback again, so we'll eventually get a correct suggestion.
24895
- return symbol || getSpellingSuggestionForName(unescapeLeadingUnderscores(name), arrayFrom(symbols.values()), meaning);
24895
+ return symbol || getSpellingSuggestionForName(unescapeLeadingUnderscores(name), arrayFrom(symbols.values()), meaning, false );
24896
24896
});
24897
24897
return result;
24898
24898
}
@@ -24903,7 +24903,7 @@ namespace ts {
24903
24903
}
24904
24904
24905
24905
function getSuggestedSymbolForNonexistentModule(name: Identifier, targetModule: Symbol): Symbol | undefined {
24906
- return targetModule.exports && getSpellingSuggestionForName(idText(name), getExportsOfModuleAsArray(targetModule), SymbolFlags.ModuleMember);
24906
+ return targetModule.exports && getSpellingSuggestionForName(idText(name), getExportsOfModuleAsArray(targetModule), SymbolFlags.ModuleMember, false );
24907
24907
}
24908
24908
24909
24909
function getSuggestionForNonexistentExport(name: Identifier, targetModule: Symbol): string | undefined {
@@ -24953,8 +24953,8 @@ namespace ts {
24953
24953
* (0.4 allows 1 substitution/transposition for every 5 characters,
24954
24954
* and 1 insertion/deletion at 3 characters)
24955
24955
*/
24956
- function getSpellingSuggestionForName(name: string, symbols: Symbol[], meaning: SymbolFlags, isJSX = false ): Symbol | undefined {
24957
- return getSpellingSuggestion(name, symbols, getCandidateName, isJSX );
24956
+ function getSpellingSuggestionForName(name: string, symbols: Symbol[], meaning: SymbolFlags, isJsxAttr: boolean ): Symbol | undefined {
24957
+ return getSpellingSuggestion(name, symbols, getCandidateName, isJsxAttr );
24958
24958
function getCandidateName(candidate: Symbol) {
24959
24959
const candidateName = symbolName(candidate);
24960
24960
if (startsWith(candidateName, "\"")) {
0 commit comments