1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
/// <reference path="fourslash.ts" />
// @module: commonjs
// @Filename: /ambient1.d.ts
//// declare module "foo" {
//// export const x = 1;
//// }
// @Filename: /ambient2.d.ts
//// declare module "foo" {
//// export const y = 2;
//// }
// @Filename: /index.ts
//// /**/
verify.completions({
marker: "",
exact: completion.globalsPlus([{
// We don't look at what file each individual export came from; we
// only include or exclude modules wholesale, so excluding part of
// an ambient module or a module augmentation isn't supported.
name: "x",
source: "foo",
sourceDisplay: "foo",
hasAction: true,
sortText: completion.SortText.AutoImportSuggestions,
}, {
name: "y",
source: "foo",
sourceDisplay: "foo",
hasAction: true,
sortText: completion.SortText.AutoImportSuggestions,
}]),
preferences: {
allowIncompleteCompletions: true,
includeCompletionsForModuleExports: true,
autoImportFileExcludePatterns: ["/**/ambient1.d.ts"],
}
});
// Here, *every* file that declared "foo" is excluded.
verify.completions({
marker: "",
exact: completion.globals,
preferences: {
allowIncompleteCompletions: true,
includeCompletionsForModuleExports: true,
autoImportFileExcludePatterns: ["/**/ambient*"],
}
});
|