mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-06 02:00:01 -06:00
Fix export=global auto import exclusion (#32898)
This commit is contained in:
parent
11c28d6dd0
commit
2217f0b859
@ -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 };
|
||||
|
||||
@ -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
|
||||
}
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user