2018-01-03 23:56:59 +01:00
|
|
|
/// <reference path="fourslash.ts" />
|
|
|
|
|
|
|
|
// Tests that we use the name "foo".
|
|
|
|
|
2018-04-02 19:21:14 +02:00
|
|
|
// @module: esnext
|
|
|
|
|
2018-01-03 23:56:59 +01:00
|
|
|
// @Filename: /a.ts
|
|
|
|
////const foo = 0;
|
|
|
|
////export default foo;
|
|
|
|
|
|
|
|
// @Filename: /b.ts
|
|
|
|
////f/**/;
|
|
|
|
|
|
|
|
goTo.marker("");
|
2018-10-29 18:03:25 +01:00
|
|
|
verify.completions({
|
|
|
|
marker: "",
|
2019-05-16 23:46:10 +02:00
|
|
|
includes: {
|
2020-01-22 14:13:04 +01:00
|
|
|
name: "foo",
|
|
|
|
source: "/a",
|
|
|
|
sourceDisplay: "./a",
|
|
|
|
text: "(alias) const foo: 0\nexport default foo",
|
|
|
|
kind: "alias",
|
|
|
|
kindModifiers: "export",
|
|
|
|
hasAction: true,
|
|
|
|
sortText: completion.SortText.AutoImportSuggestions
|
2019-05-16 23:46:10 +02:00
|
|
|
},
|
2018-10-29 18:03:25 +01:00
|
|
|
preferences: { includeCompletionsForModuleExports: true },
|
2018-01-03 23:56:59 +01:00
|
|
|
});
|
2020-01-22 14:13:04 +01:00
|
|
|
|
2018-01-03 23:56:59 +01:00
|
|
|
verify.applyCodeActionFromCompletion("", {
|
|
|
|
name: "foo",
|
|
|
|
source: "/a",
|
2018-08-01 02:28:35 +02:00
|
|
|
description: `Import default 'foo' from module "./a"`,
|
2018-01-12 02:43:27 +01:00
|
|
|
newFileContent: `import foo from "./a";
|
|
|
|
|
2018-01-03 23:56:59 +01:00
|
|
|
f;`,
|
|
|
|
});
|