2018-04-26 01:15:49 +02:00
|
|
|
/// <reference path="fourslash.ts" />
|
|
|
|
|
|
|
|
// @Filename: /src/a.ts
|
|
|
|
////export const x = 0;
|
|
|
|
|
|
|
|
// @Filename: /src/index.ts
|
|
|
|
////export { x } from "./a";
|
|
|
|
|
|
|
|
// @Filename: /0.ts
|
|
|
|
////x/*0*/
|
|
|
|
|
|
|
|
// @Filename: /src/1.ts
|
|
|
|
////x/*1*/
|
|
|
|
|
|
|
|
// @Filename: /src/inner/2.ts
|
|
|
|
////x/*2*/
|
|
|
|
|
|
|
|
for (const [marker, sourceDisplay] of [["0", "./src"], ["1", "./a"], ["2", "../a"]]) {
|
2018-10-29 18:03:25 +01:00
|
|
|
verify.completions({
|
|
|
|
marker,
|
2018-10-30 19:56:34 +01:00
|
|
|
includes: {
|
|
|
|
name: "x",
|
|
|
|
source: "/src/a",
|
|
|
|
sourceDisplay,
|
|
|
|
text: "const x: 0",
|
|
|
|
kind: "const",
|
|
|
|
kindModifiers: "export",
|
|
|
|
hasAction: true,
|
2019-05-16 23:46:10 +02:00
|
|
|
sortText: completion.SortText.AutoImportSuggestions
|
2018-10-30 19:56:34 +01:00
|
|
|
},
|
2018-10-29 18:03:25 +01:00
|
|
|
preferences: { includeCompletionsForModuleExports: true },
|
|
|
|
});
|
2018-04-26 01:15:49 +02:00
|
|
|
verify.applyCodeActionFromCompletion(marker, {
|
|
|
|
name: "x",
|
|
|
|
source: "/src/a",
|
|
|
|
description: `Import 'x' from module "${sourceDisplay}"`,
|
|
|
|
newFileContent: `import { x } from "${sourceDisplay}";\n\nx`,
|
|
|
|
});
|
|
|
|
}
|