* Support multiple completions with the same name but different source module * Use optional parameters for source * Simplify use of `uniques` * Update test * Fix `undefined` error
21 lines
550 B
TypeScript
21 lines
550 B
TypeScript
/// <reference path="fourslash.ts" />
|
|
|
|
// @Filename: /a.ts
|
|
////export function foo() {}
|
|
////export const x = 0;
|
|
|
|
// @Filename: /b.ts
|
|
////import { x } from "./a";
|
|
////f/**/;
|
|
|
|
goTo.marker("");
|
|
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true);
|
|
|
|
verify.applyCodeActionFromCompletion("", {
|
|
name: "foo",
|
|
source: "/a",
|
|
description: `Add 'foo' to existing import declaration from "./a".`,
|
|
newFileContent: `import { x, foo } from "./a";
|
|
f;`,
|
|
});
|