mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
* Have CompletionEntryDetails source use a relative path * Use getCanonicalFileName from services Instead of creating a new one
This commit is contained in:
@@ -9,7 +9,10 @@
|
||||
////f/**/;
|
||||
|
||||
goTo.marker("");
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, { includeExternalModuleExports: true });
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, {
|
||||
includeExternalModuleExports: true,
|
||||
sourceDisplay: "./a",
|
||||
});
|
||||
|
||||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
////f/**/;
|
||||
|
||||
goTo.marker("");
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, { includeExternalModuleExports: true });
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, {
|
||||
includeExternalModuleExports: true,
|
||||
sourceDisplay: "./a",
|
||||
});
|
||||
|
||||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
////f/**/;
|
||||
|
||||
goTo.marker("");
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, { includeExternalModuleExports: true });
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, {
|
||||
includeExternalModuleExports: true,
|
||||
sourceDisplay: "./a",
|
||||
});
|
||||
|
||||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
|
||||
@@ -10,10 +10,14 @@
|
||||
////fooB/*1*/
|
||||
|
||||
goTo.marker("0");
|
||||
verify.not.completionListContains({ name: "default", source: "/src/foo-bar" }, undefined, undefined, undefined, undefined, undefined, { includeExternalModuleExports: true });
|
||||
const options = {
|
||||
includeExternalModuleExports: true,
|
||||
sourceDisplay: "./foo-bar",
|
||||
};
|
||||
verify.not.completionListContains({ name: "default", source: "/src/foo-bar" }, undefined, undefined, undefined, undefined, undefined, options);
|
||||
|
||||
goTo.marker("1");
|
||||
verify.completionListContains({ name: "fooBar", source: "/src/foo-bar" }, "(property) default: 0", "", "property", /*spanIndex*/ undefined, /*hasAction*/ true, { includeExternalModuleExports: true });
|
||||
verify.completionListContains({ name: "fooBar", source: "/src/foo-bar" }, "(property) default: 0", "", "property", /*spanIndex*/ undefined, /*hasAction*/ true, options);
|
||||
verify.applyCodeActionFromCompletion("1", {
|
||||
name: "fooBar",
|
||||
source: "/src/foo-bar",
|
||||
|
||||
@@ -7,7 +7,10 @@
|
||||
////f/**/;
|
||||
|
||||
goTo.marker("");
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, { includeExternalModuleExports: true });
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, {
|
||||
includeExternalModuleExports: true,
|
||||
sourceDisplay: "./a",
|
||||
});
|
||||
|
||||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
goTo.marker("");
|
||||
|
||||
const options = { includeExternalModuleExports: true };
|
||||
const options = { includeExternalModuleExports: true, sourceDisplay: "./a" };
|
||||
verify.not.completionListContains({ name: "abcde", source: "/a" }, undefined, undefined, undefined, undefined, undefined, options);
|
||||
verify.not.completionListContains({ name: "dbf", source: "/a" }, undefined, undefined, undefined, undefined, undefined, options);
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
////fo/**/
|
||||
|
||||
goTo.marker("");
|
||||
const options = { includeExternalModuleExports: true };
|
||||
const options = { includeExternalModuleExports: true, sourceDisplay: undefined };
|
||||
verify.completionListContains("foo", "var foo: number", "", "var", undefined, undefined, options);
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "", "const", /*spanIndex*/ undefined, /*hasAction*/ true, options);
|
||||
verify.completionListContains({ name: "foo", source: "/b" }, "const foo: 1", "", "const", /*spanIndex*/ undefined, /*hasAction*/ true, options);
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "", "const", /*spanIndex*/ undefined, /*hasAction*/ true, { ...options, sourceDisplay: "./a" });
|
||||
verify.completionListContains({ name: "foo", source: "/b" }, "const foo: 1", "", "const", /*spanIndex*/ undefined, /*hasAction*/ true, { ...options, sourceDisplay: "./b" });
|
||||
|
||||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
|
||||
@@ -9,7 +9,10 @@
|
||||
////f/**/;
|
||||
|
||||
goTo.marker("");
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, { includeExternalModuleExports: true });
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, {
|
||||
includeExternalModuleExports: true,
|
||||
sourceDisplay: "./a",
|
||||
});
|
||||
|
||||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
////t/**/
|
||||
|
||||
goTo.marker("");
|
||||
const options = { includeExternalModuleExports: true };
|
||||
verify.completionListContains({ name: "Test1", source: "/a" }, "function Test1(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, options);
|
||||
const options = { includeExternalModuleExports: true, sourceDisplay: undefined };
|
||||
verify.completionListContains({ name: "Test1", source: "/a" }, "function Test1(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, { ...options, sourceDisplay: "./a" });
|
||||
verify.completionListContains("Test2", "import Test2", "", "alias", /*spanIndex*/ undefined, /*hasAction*/ undefined, options);
|
||||
verify.not.completionListContains({ name: "Test2", source: "/a" }, undefined, undefined, undefined, undefined, undefined, options);
|
||||
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
////f/**/;
|
||||
|
||||
goTo.marker("");
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, { includeExternalModuleExports: true });
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, {
|
||||
includeExternalModuleExports: true,
|
||||
sourceDisplay: "./a",
|
||||
});
|
||||
|
||||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
////fo/**/
|
||||
|
||||
goTo.marker("");
|
||||
const options = { includeExternalModuleExports: true };
|
||||
const options = { includeExternalModuleExports: true, sourceDisplay: "./a" };
|
||||
// TODO: https://github.com/Microsoft/TypeScript/issues/14003
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "import foo", "", "alias", /*spanIndex*/ undefined, /*hasAction*/ true, options);
|
||||
verify.not.completionListContains({ name: "foo", source: "/a_reexport" }, undefined, undefined, undefined, undefined, undefined, options);
|
||||
|
||||
@@ -8,4 +8,7 @@
|
||||
/////**/
|
||||
|
||||
goTo.marker("");
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, { includeExternalModuleExports: true });
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): void", "", "function", /*spanIndex*/ undefined, /*hasAction*/ true, {
|
||||
includeExternalModuleExports: true,
|
||||
sourceDisplay: "./a",
|
||||
});
|
||||
|
||||
@@ -14,7 +14,10 @@
|
||||
////fo/*c*/
|
||||
|
||||
goTo.marker("b");
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "", "const", /*spanIndex*/ undefined, /*hasAction*/ true, { includeExternalModuleExports: true });
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "", "const", /*spanIndex*/ undefined, /*hasAction*/ true, {
|
||||
includeExternalModuleExports: true,
|
||||
sourceDisplay: "./a",
|
||||
});
|
||||
|
||||
verify.applyCodeActionFromCompletion("b", {
|
||||
name: "foo",
|
||||
@@ -28,7 +31,10 @@ fo`,
|
||||
});
|
||||
|
||||
goTo.marker("c");
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "", "const", /*spanIndex*/ undefined, /*hasAction*/ true, { includeExternalModuleExports: true });
|
||||
verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "", "const", /*spanIndex*/ undefined, /*hasAction*/ true, {
|
||||
includeExternalModuleExports: true,
|
||||
sourceDisplay: "./a",
|
||||
});
|
||||
|
||||
verify.applyCodeActionFromCompletion("c", {
|
||||
name: "foo",
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
////fo/**/
|
||||
|
||||
goTo.marker("");
|
||||
const options = { includeExternalModuleExports: true };
|
||||
const options = { includeExternalModuleExports: true, sourceDisplay: undefined };
|
||||
verify.completionListContains("foo", "const foo: 1", "", "const", undefined, undefined, options);
|
||||
verify.not.completionListContains({ name: "foo", source: "/a" }, undefined, undefined, undefined, undefined, undefined, options);
|
||||
|
||||
@@ -148,7 +148,7 @@ declare namespace FourSlashInterface {
|
||||
kind?: string,
|
||||
spanIndex?: number,
|
||||
hasAction?: boolean,
|
||||
options?: { includeExternalModuleExports: boolean },
|
||||
options?: { includeExternalModuleExports: boolean, sourceDisplay: string },
|
||||
): void;
|
||||
completionListItemsCountIsGreaterThan(count: number): void;
|
||||
completionListIsEmpty(): void;
|
||||
|
||||
Reference in New Issue
Block a user