@@ -1343,12 +1343,9 @@ namespace ts.Completions {
1343
1343
}
1344
1344
1345
1345
const symbolId = getSymbolId ( symbol ) ;
1346
- const existingSymbol = findLast ( symbols , symbol => symbol . id === symbolId ) ;
1347
- if ( ! existingSymbol ) {
1348
- symbols . push ( symbol ) ;
1349
- symbolToOriginInfoMap [ symbolId ] = origin ;
1350
- symbolToSortTextMap [ symbolId ] = SortText . AutoImportSuggestions ;
1351
- }
1346
+ symbols . push ( symbol ) ;
1347
+ symbolToOriginInfoMap [ symbolId ] = origin ;
1348
+ symbolToSortTextMap [ symbolId ] = SortText . AutoImportSuggestions ;
1352
1349
} ) ;
1353
1350
}
1354
1351
filterGlobalCompletion ( symbols ) ;
@@ -1468,7 +1465,7 @@ namespace ts.Completions {
1468
1465
}
1469
1466
1470
1467
/**
1471
- * Gathers symbols that can be imported from other files, deduplicating along the way. Symbols can be “ duplicates”
1468
+ * Gathers symbols that can be imported from other files, de-duplicating along the way. Symbols can be " duplicates"
1472
1469
* if re-exported from another module, e.g. `export { foo } from "./a"`. That syntax creates a fresh symbol, but
1473
1470
* it’s just an alias to the first, and both have the same name, so we generally want to filter those aliases out,
1474
1471
* if and only if the the first can be imported (it may be excluded due to package.json filtering in
@@ -1552,7 +1549,7 @@ namespace ts.Completions {
1552
1549
// Don't add another completion for `export =` of a symbol that's already global.
1553
1550
// So in `declare namespace foo {} declare module "foo" { export = foo; }`, there will just be the global completion for `foo`.
1554
1551
if ( resolvedModuleSymbol !== moduleSymbol &&
1555
- every ( resolvedModuleSymbol . declarations , d => ! ! d . getSourceFile ( ) . externalModuleIndicator ) ) {
1552
+ every ( resolvedModuleSymbol . declarations , d => ! ! d . getSourceFile ( ) . externalModuleIndicator && ! findAncestor ( d , ts . isGlobalScopeAugmentation ) ) ) {
1556
1553
pushSymbol ( resolvedModuleSymbol , moduleSymbol , /*skipFilter*/ true ) ;
1557
1554
}
1558
1555
0 commit comments