Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/services/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ namespace ts.Completions {
if (resolvedModuleSymbol !== moduleSymbol &&
// Don't add another completion for `export =` of a symbol that's already global.
// So in `declare namespace foo {} declare module "foo" { export = foo; }`, there will just be the global completion for `foo`.
some(resolvedModuleSymbol.declarations, d => !!d.getSourceFile().externalModuleIndicator)) {
every(resolvedModuleSymbol.declarations, d => !!d.getSourceFile().externalModuleIndicator)) {
symbols.push(resolvedModuleSymbol);
symbolToSortTextMap[getSymbolId(resolvedModuleSymbol)] = SortText.AutoImportSuggestions;
symbolToOriginInfoMap[getSymbolId(resolvedModuleSymbol)] = { kind: SymbolOriginInfoKind.Export, moduleSymbol, isDefaultExport: false };
Expand Down
31 changes: 31 additions & 0 deletions tests/cases/fourslash/completionsImport_exportEquals_global.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/// <reference path="fourslash.ts" />

// @module: es6

// @Filename: /console.d.ts
////interface Console {}
////declare var console: Console;
////declare module "console" {
//// export = console;
////}

// @Filename: /react-native.d.ts
//// import 'console';
////declare global {
//// interface Console {}
//// var console: Console;
////}

// @Filename: /a.ts
////conso/**/

verify.completions({
exact: completion.globalsPlus([{
hasAction: undefined, // asserts that it does *not* have an action
name: "console"
}]),
preferences: {
includeCompletionsForModuleExports: true,
includeInsertTextCompletions: true
}
});