Support import completions for a re-export with a different name from the original (#28055)

This commit is contained in:
Andy
2018-10-22 11:16:39 -07:00
committed by GitHub
parent 778f438a7f
commit 8e0142d709
2 changed files with 17 additions and 4 deletions

View File

@@ -1410,7 +1410,7 @@ namespace ts.Completions {
// If `symbol.parent !== ...`, this comes from an `export * from "foo"` re-export. Those don't create new symbols.
// If `some(...)`, this comes from an `export { foo } from "foo"` re-export, which creates a new symbol (thus isn't caught by the first check).
if (typeChecker.getMergedSymbol(symbol.parent!) !== resolvedModuleSymbol
|| some(symbol.declarations, d => isExportSpecifier(d) && !!d.parent.parent.moduleSpecifier)) {
|| some(symbol.declarations, d => isExportSpecifier(d) && !d.propertyName && !!d.parent.parent.moduleSpecifier)) {
continue;
}