-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don’t let other completions shadow type keywords in type locations (#…
…48939) * Allow type keywords with the same names as other completions * Only add type keywords that are the same as other completions in type locations
- Loading branch information
1 parent
d337cbc
commit d879880
Showing
2 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
tests/cases/fourslash/server/autoImportProvider_namespaceSameNameAsIntrinsic.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/// <reference path="../fourslash.ts" /> | ||
|
||
// @Filename: /node_modules/fp-ts/package.json | ||
//// { "name": "fp-ts", "version": "0.10.4" } | ||
|
||
// @Filename: /node_modules/fp-ts/index.d.ts | ||
//// export * as string from "./lib/string"; | ||
|
||
// @Filename: /node_modules/fp-ts/lib/string.d.ts | ||
//// export declare const fromString: (s: string) => string; | ||
//// export type SafeString = string; | ||
|
||
// @Filename: /package.json | ||
//// { "dependencies": { "fp-ts": "^0.10.4" } } | ||
|
||
// @Filename: /tsconfig.json | ||
//// { "compilerOptions": { "module": "commonjs" } } | ||
|
||
// @Filename: /index.ts | ||
//// type A = { name: string/**/ } | ||
|
||
goTo.marker(""); | ||
verify.completions({ | ||
marker: "", | ||
includes: [{ | ||
name: "string", | ||
sortText: completion.SortText.GlobalsOrKeywords, | ||
}, { | ||
name: "string", | ||
sortText: completion.SortText.AutoImportSuggestions, | ||
source: "fp-ts", | ||
sourceDisplay: "fp-ts", | ||
hasAction: true, | ||
}], | ||
preferences: { | ||
includeCompletionsForModuleExports: true, | ||
allowIncompleteCompletions: true, | ||
}, | ||
}); |