2017-10-26 17:22:17 +02:00
|
|
|
/// <reference path="fourslash.ts" />
|
|
|
|
|
|
|
|
// Tests that we don't filter out a completion for an alias,
|
|
|
|
// so long as it's not an alias to a different module.
|
|
|
|
|
2018-04-02 19:21:14 +02:00
|
|
|
// @module: esnext
|
|
|
|
|
2017-10-26 17:22:17 +02:00
|
|
|
// @Filename: /a.ts
|
|
|
|
////const foo = 0;
|
|
|
|
////export { foo };
|
|
|
|
|
|
|
|
// @Filename: /a_reexport.ts
|
|
|
|
// Should not show up in completions
|
|
|
|
////export { foo } from "./a";
|
|
|
|
|
2017-11-16 20:15:14 +01:00
|
|
|
// @Filename: /a_reexport_2.ts
|
|
|
|
////export * from "./a";
|
|
|
|
|
2019-09-27 22:38:31 +02:00
|
|
|
// @Filename: /a_reexport_3.ts
|
|
|
|
////export { foo } from "./a_reexport";
|
|
|
|
|
2017-10-26 17:22:17 +02:00
|
|
|
// @Filename: /b.ts
|
|
|
|
////fo/**/
|
|
|
|
|
2018-05-01 22:00:13 +02:00
|
|
|
verify.completions({
|
2018-05-03 22:04:08 +02:00
|
|
|
marker: "",
|
2018-10-29 18:03:25 +01:00
|
|
|
includes: [
|
2019-05-16 23:46:10 +02:00
|
|
|
completion.undefinedVarEntry,
|
|
|
|
{
|
2019-09-27 22:38:31 +02:00
|
|
|
name: "foo",
|
|
|
|
source: "/a",
|
|
|
|
sourceDisplay: "./a",
|
|
|
|
text: "(alias) const foo: 0\nexport foo",
|
|
|
|
kind: "alias",
|
|
|
|
hasAction: true,
|
|
|
|
sortText: completion.SortText.AutoImportSuggestions
|
2019-05-16 23:46:10 +02:00
|
|
|
},
|
2018-10-29 18:03:25 +01:00
|
|
|
...completion.statementKeywordsWithTypes,
|
|
|
|
],
|
2018-05-01 22:00:13 +02:00
|
|
|
preferences: { includeCompletionsForModuleExports: true },
|
|
|
|
});
|
2017-10-26 17:22:17 +02:00
|
|
|
|
|
|
|
verify.applyCodeActionFromCompletion("", {
|
|
|
|
name: "foo",
|
|
|
|
source: "/a",
|
2017-12-02 01:38:59 +01:00
|
|
|
description: `Import 'foo' from module "./a"`,
|
2018-01-12 02:43:27 +01:00
|
|
|
newFileContent: `import { foo } from "./a";
|
|
|
|
|
2017-10-26 17:22:17 +02:00
|
|
|
fo`,
|
|
|
|
});
|