Add regression test for #46192 (#49057)

This commit is contained in:
Andrew Branch 2022-05-10 16:27:46 -07:00 committed by GitHub
parent 8bf45a4f93
commit 08b1cce595
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 62 additions and 3 deletions

View File

@ -404,8 +404,8 @@ namespace FourSlashInterface {
this.state.baselineSignatureHelp();
}
public baselineCompletions() {
this.state.baselineCompletions();
public baselineCompletions(preferences?: ts.UserPreferences) {
this.state.baselineCompletions(preferences);
}
public baselineSmartSelection() {

View File

@ -0,0 +1,59 @@
/// <reference path="fourslash.ts" />
// @Filename: /tsconfig.json
//// {
//// "compilerOptions": {
//// "module": "commonjs",
//// "paths": {
//// "~/*": ["src/*"]
//// }
//// }
////}
// @Filename: /src/dirA/index.ts
//// export * from "./thing1A";
//// export * from "./thing2A";
// @Filename: /src/dirA/thing1A.ts
//// export class Thing1A {}
//// Thing/**/
// @Filename: /src/dirA/thing2A.ts
//// export class Thing2A {}
// @Filename: /src/dirB/index.ts
//// export * from "./thing1B";
//// export * from "./thing2B";
// @Filename: /src/dirB/thing1B.ts
//// export class Thing1B {}
// @Filename: /src/dirB/thing2B.ts
//// export class Thing2B {}
verify.completions({
marker: "",
includes: [{
name: "Thing2A",
source: "./thing2A",
sourceDisplay: "./thing2A",
hasAction: true,
sortText: completion.SortText.AutoImportSuggestions,
}, {
name: "Thing1B",
source: "~/dirB",
sourceDisplay: "~/dirB",
hasAction: true,
sortText: completion.SortText.AutoImportSuggestions,
}, {
name: "Thing2B",
source: "~/dirB",
sourceDisplay: "~/dirB",
hasAction: true,
sortText: completion.SortText.AutoImportSuggestions,
}],
preferences: {
includeCompletionsForModuleExports: true,
allowIncompleteCompletions: true,
},
});

View File

@ -349,7 +349,7 @@ declare namespace FourSlashInterface {
baselineSyntacticDiagnostics(): void;
baselineSyntacticAndSemanticDiagnostics(): void;
getEmitOutput(expectedOutputFiles: ReadonlyArray<string>): void;
baselineCompletions(): void;
baselineCompletions(preferences?: UserPreferences): void;
baselineQuickInfo(): void;
baselineSmartSelection(): void;
baselineSignatureHelp(): void;