-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure AutoImportProviderProject can share source files with main pro…
…gram (#44274) * Ensure AutoImportProviderProject can share source files with main program * Revert package-lock change * Add back reclassified options
- Loading branch information
1 parent
2ffd35d
commit b1eaf3e
Showing
4 changed files
with
64 additions
and
18 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
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
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
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,36 @@ | ||
/// <reference path="../fourslash.ts" /> | ||
|
||
// @Filename: /tsconfig.json | ||
//// { "compilerOptions": { "module": "commonjs", "lib": ["es2019"] } } | ||
|
||
// @Filename: /package.json | ||
//// { "dependencies": { "antd": "*", "react": "*" } } | ||
|
||
// @Filename: /node_modules/@types/react/index.d.ts | ||
//// export declare function Component(): void; | ||
|
||
// @Filename: /node_modules/antd/index.d.ts | ||
//// import "react"; | ||
|
||
// @Filename: /index.ts | ||
//// Component/**/ | ||
|
||
// react/index.d.ts will be in both the auto import provider program | ||
// and the main program, and will result in duplicate completions | ||
// unless the two programs successfully share the same source file. | ||
// This tests the configuration of the AutoImportProviderProject. | ||
// See also the 'Can use the same document registry bucket key as main program' | ||
// unit test in autoImportProvider.ts. | ||
goTo.marker(""); | ||
verify.completions({ | ||
marker: "", | ||
includes: [{ | ||
name: "Component", | ||
hasAction: true, | ||
source: "/node_modules/@types/react/index", | ||
sortText: completion.SortText.AutoImportSuggestions, | ||
}], | ||
preferences: { | ||
includeCompletionsForModuleExports: true, | ||
}, | ||
}); |