diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax1.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax1.ts new file mode 100644 index 00000000000..93107ef669b --- /dev/null +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax1.ts @@ -0,0 +1,4 @@ +/// +//// var x: [|?|] = 12; + +verify.rangeAfterCodeFix("any"); diff --git a/tests/cases/fourslash/completionInJSDocFunctionNew.ts b/tests/cases/fourslash/completionInJSDocFunctionNew.ts new file mode 100644 index 00000000000..9e19964cd25 --- /dev/null +++ b/tests/cases/fourslash/completionInJSDocFunctionNew.ts @@ -0,0 +1,10 @@ + +/// +// @allowJs: true +// @Filename: Foo.js +/////** @type {function (new: string, string): string} */ +////var f = function (s) { return /**/; } + +goTo.marker(); +verify.completionListCount(115); +verify.completionListContains('new', 'new', '', 'keyword'); diff --git a/tests/cases/fourslash/completionInJSDocFunctionThis.ts b/tests/cases/fourslash/completionInJSDocFunctionThis.ts new file mode 100644 index 00000000000..3fe02825d4c --- /dev/null +++ b/tests/cases/fourslash/completionInJSDocFunctionThis.ts @@ -0,0 +1,9 @@ +/// +// @allowJs: true +// @Filename: Foo.js +/////** @type {function (this: string, string): string} */ +////var f = function (s) { return /**/; } + +goTo.marker(); +verify.completionListCount(115); +verify.completionListContains('this'); diff --git a/tests/cases/fourslash/findAllReferencesJSDocFunctionNew.ts b/tests/cases/fourslash/findAllReferencesJSDocFunctionNew.ts new file mode 100644 index 00000000000..e75040d1f77 --- /dev/null +++ b/tests/cases/fourslash/findAllReferencesJSDocFunctionNew.ts @@ -0,0 +1,9 @@ +/// +// @allowJs: true +// @Filename: Foo.js +/////** @type {function ([|new|]: string, string): string} */ +////var f; + +const [a0] = test.ranges(); +// should be: verify.referenceGroups([a0], [{ definition: "new", ranges: [a0] }]); +verify.referenceGroups([a0], undefined); diff --git a/tests/cases/fourslash/findAllReferencesJSDocFunctionThis.ts b/tests/cases/fourslash/findAllReferencesJSDocFunctionThis.ts new file mode 100644 index 00000000000..1f00e9f5647 --- /dev/null +++ b/tests/cases/fourslash/findAllReferencesJSDocFunctionThis.ts @@ -0,0 +1,11 @@ +/// +// @allowJs: true +// @Filename: Foo.js +/////** @type {function (this: string, string): string} */ +////var f = function (s) { return [|this|] + s; } + +const [a0] = test.ranges(); +// should be: verify.referenceGroups([a0, a1], [{ definition: "this", ranges: [a0] }]); + +// but is currently +verify.referenceGroups([], undefined); diff --git a/tests/cases/fourslash/quickInfoJSDocFunctionNew.ts b/tests/cases/fourslash/quickInfoJSDocFunctionNew.ts new file mode 100644 index 00000000000..5fed7d9a39a --- /dev/null +++ b/tests/cases/fourslash/quickInfoJSDocFunctionNew.ts @@ -0,0 +1,8 @@ +/// +// @allowJs: true +// @Filename: Foo.js +/////** @type {function (new: string, string): string} */ +////var f/**/; + +goTo.marker(); +verify.quickInfoIs('var f: new (arg1: string) => string'); diff --git a/tests/cases/fourslash/quickInfoJSDocFunctionThis.ts b/tests/cases/fourslash/quickInfoJSDocFunctionThis.ts new file mode 100644 index 00000000000..5568ff829f1 --- /dev/null +++ b/tests/cases/fourslash/quickInfoJSDocFunctionThis.ts @@ -0,0 +1,9 @@ + +/// +// @allowJs: true +// @Filename: Foo.js +/////** @type {function (this: string, string): string} */ +////var f/**/ = function (s) { return s; } + +goTo.marker(); +verify.quickInfoIs('var f: (this: string, arg1: string) => string');