getSuggestionForNonexistentModule -> getSuggestionForNonexistentExport

This commit is contained in:
Daniel Rosenwasser 2018-07-05 20:42:13 -07:00
parent b93845ae51
commit 32bb63cbcf
3 changed files with 4 additions and 4 deletions

View file

@ -295,7 +295,7 @@ namespace ts {
getAllPossiblePropertiesOfTypes,
getSuggestionForNonexistentProperty: (node, type) => getSuggestionForNonexistentProperty(node, type),
getSuggestionForNonexistentSymbol: (location, name, meaning) => getSuggestionForNonexistentSymbol(location, escapeLeadingUnderscores(name), meaning),
getSuggestionForNonexistentModule: (node, target) => getSuggestionForNonexistentModule(node, target),
getSuggestionForNonexistentExport: (node, target) => getSuggestionForNonexistentExport(node, target),
getBaseConstraintOfType,
getDefaultFromTypeParameter: type => type && type.flags & TypeFlags.TypeParameter ? getDefaultFromTypeParameter(type as TypeParameter) : undefined,
resolveName(name, location, meaning, excludeGlobals) {
@ -17787,7 +17787,7 @@ namespace ts {
return targetModule.exports && getSpellingSuggestionForName(idText(name), getExportsOfModuleAsArray(targetModule), SymbolFlags.ModuleMember);
}
function getSuggestionForNonexistentModule(name: Identifier, targetModule: Symbol): string | undefined {
function getSuggestionForNonexistentExport(name: Identifier, targetModule: Symbol): string | undefined {
const suggestion = getSuggestedSymbolForNonexistentModule(name, targetModule);
return suggestion && symbolName(suggestion);
}

View file

@ -2996,7 +2996,7 @@ namespace ts {
getApparentType(type: Type): Type;
getSuggestionForNonexistentProperty(name: Identifier | string, containingType: Type): string | undefined;
getSuggestionForNonexistentSymbol(location: Node, name: string, meaning: SymbolFlags): string | undefined;
getSuggestionForNonexistentModule(node: Identifier, target: Symbol): string | undefined;
getSuggestionForNonexistentExport(node: Identifier, target: Symbol): string | undefined;
getBaseConstraintOfType(type: Type): Type | undefined;
getDefaultFromTypeParameter(type: Type): Type | undefined;

View file

@ -43,7 +43,7 @@ namespace ts.codefix {
const importDeclaration = findAncestor(node, isImportDeclaration)!;
const resolvedSourceFile = getResolvedSourceFileFromImportDeclaration(sourceFile, context, importDeclaration);
if (resolvedSourceFile && resolvedSourceFile.symbol) {
suggestion = checker.getSuggestionForNonexistentModule(node as Identifier, resolvedSourceFile.symbol);
suggestion = checker.getSuggestionForNonexistentExport(node as Identifier, resolvedSourceFile.symbol);
}
}
else {