2017-11-09 22:13:23 +01:00
|
|
|
/// <reference path="fourslash.ts" />
|
|
|
|
|
|
|
|
// Use `/src` to test that directory names are not included in conversion from module path to identifier.
|
2018-04-02 19:21:14 +02:00
|
|
|
// @module: esnext
|
2018-10-29 18:03:25 +01:00
|
|
|
// @noLib: true
|
2017-11-09 22:13:23 +01:00
|
|
|
|
|
|
|
// @Filename: /src/foo-bar.ts
|
|
|
|
////export default 0;
|
|
|
|
|
|
|
|
// @Filename: /src/b.ts
|
|
|
|
////def/*0*/
|
|
|
|
////fooB/*1*/
|
|
|
|
|
|
|
|
goTo.marker("0");
|
2018-08-28 22:04:11 +02:00
|
|
|
const preferences: FourSlashInterface.UserPreferences = { includeCompletionsForModuleExports: true };
|
2018-05-01 22:00:13 +02:00
|
|
|
verify.completions(
|
2019-06-06 19:48:26 +02:00
|
|
|
{
|
2019-05-16 23:46:10 +02:00
|
|
|
marker: "0",
|
|
|
|
exact: [
|
2019-06-06 19:48:26 +02:00
|
|
|
completion.globalThisEntry,
|
|
|
|
completion.undefinedVarEntry,
|
|
|
|
...completion.statementKeywordsWithTypes
|
|
|
|
],
|
|
|
|
preferences
|
2019-05-16 23:46:10 +02:00
|
|
|
},
|
2018-10-29 18:03:25 +01:00
|
|
|
{
|
|
|
|
marker: "1",
|
2019-05-16 23:46:10 +02:00
|
|
|
includes: {
|
2019-06-06 19:48:26 +02:00
|
|
|
name: "fooBar",
|
|
|
|
source: "/src/foo-bar",
|
|
|
|
sourceDisplay: "./foo-bar",
|
|
|
|
text: "(property) default: 0",
|
|
|
|
kind: "property",
|
2020-01-22 14:13:04 +01:00
|
|
|
kindModifiers: "export",
|
2019-06-06 19:48:26 +02:00
|
|
|
hasAction: true,
|
|
|
|
sortText: completion.SortText.AutoImportSuggestions
|
2019-05-16 23:46:10 +02:00
|
|
|
},
|
2018-10-29 18:03:25 +01:00
|
|
|
preferences,
|
|
|
|
},
|
2018-05-01 22:00:13 +02:00
|
|
|
);
|
2017-11-09 22:13:23 +01:00
|
|
|
verify.applyCodeActionFromCompletion("1", {
|
|
|
|
name: "fooBar",
|
|
|
|
source: "/src/foo-bar",
|
2018-08-01 02:28:35 +02:00
|
|
|
description: `Import default 'fooBar' from module "./foo-bar"`,
|
2019-06-06 19:48:26 +02:00
|
|
|
newFileContent: `import fooBar from "./foo-bar"
|
2018-01-12 02:43:27 +01:00
|
|
|
|
2017-11-09 22:13:23 +01:00
|
|
|
def
|
|
|
|
fooB`,
|
|
|
|
});
|