Skip to content

Commit ee2465a

Browse files
committed
Add regression test for microsoft#46192
1 parent 6ee5490 commit ee2465a

File tree

3 files changed

+62
-3
lines changed

3 files changed

+62
-3
lines changed

src/harness/fourslashInterfaceImpl.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ namespace FourSlashInterface {
404404
this.state.baselineSignatureHelp();
405405
}
406406

407-
public baselineCompletions() {
408-
this.state.baselineCompletions();
407+
public baselineCompletions(preferences?: ts.UserPreferences) {
408+
this.state.baselineCompletions(preferences);
409409
}
410410

411411
public baselineSmartSelection() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @Filename: /tsconfig.json
4+
//// {
5+
//// "compilerOptions": {
6+
//// "module": "commonjs",
7+
//// "paths": {
8+
//// "~/*": ["src/*"]
9+
//// }
10+
//// }
11+
////}
12+
13+
// @Filename: /src/dirA/index.ts
14+
//// export * from "./thing1A";
15+
//// export * from "./thing2A";
16+
17+
// @Filename: /src/dirA/thing1A.ts
18+
//// export class Thing1A {}
19+
//// Thing/**/
20+
21+
// @Filename: /src/dirA/thing2A.ts
22+
//// export class Thing2A {}
23+
24+
// @Filename: /src/dirB/index.ts
25+
//// export * from "./thing1B";
26+
//// export * from "./thing2B";
27+
28+
// @Filename: /src/dirB/thing1B.ts
29+
//// export class Thing1B {}
30+
31+
// @Filename: /src/dirB/thing2B.ts
32+
//// export class Thing2B {}
33+
34+
verify.completions({
35+
marker: "",
36+
includes: [{
37+
name: "Thing2A",
38+
source: "./thing2A",
39+
sourceDisplay: "./thing2A",
40+
hasAction: true,
41+
sortText: completion.SortText.AutoImportSuggestions,
42+
}, {
43+
name: "Thing1B",
44+
source: "~/dirB",
45+
sourceDisplay: "~/dirB",
46+
hasAction: true,
47+
sortText: completion.SortText.AutoImportSuggestions,
48+
}, {
49+
name: "Thing2B",
50+
source: "~/dirB",
51+
sourceDisplay: "~/dirB",
52+
hasAction: true,
53+
sortText: completion.SortText.AutoImportSuggestions,
54+
}],
55+
preferences: {
56+
includeCompletionsForModuleExports: true,
57+
allowIncompleteCompletions: true,
58+
},
59+
});

tests/cases/fourslash/fourslash.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ declare namespace FourSlashInterface {
349349
baselineSyntacticDiagnostics(): void;
350350
baselineSyntacticAndSemanticDiagnostics(): void;
351351
getEmitOutput(expectedOutputFiles: ReadonlyArray<string>): void;
352-
baselineCompletions(): void;
352+
baselineCompletions(preferences?: UserPreferences): void;
353353
baselineQuickInfo(): void;
354354
baselineSmartSelection(): void;
355355
baselineSignatureHelp(): void;

0 commit comments

Comments
 (0)