-
Notifications
You must be signed in to change notification settings - Fork 963
Adding signature help tooltip coloring support for VS #3821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
74159fb
cleanup
navya9singh 40cb407
Merge branch 'main' of https://github.com/microsoft/typescript-go int…
navya9singh bf0b4cd
updating failingTests.txt
navya9singh 8f1f8fe
addressing comments
navya9singh b88940a
fixing baselines
navya9singh 980733b
adding vsCapability to sigHelp baseline tests
navya9singh 0239d8b
Merge branch 'main' of https://github.com/microsoft/typescript-go int…
navya9singh d1a2ad0
removing vsCapability from the generated baselines
navya9singh bbaf106
manual tests with VS capability enabled
navya9singh a8260ee
fix formatting and updating failingTests.txt
navya9singh 7493a0e
update baseline
navya9singh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,6 @@ TestAutoImportSortCaseSensitivity1 | |
| TestAutoImportTypeImport4 | ||
| TestAutoImportTypeOnlyPreferred3 | ||
| TestAutoImportVerbatimTypeOnly1 | ||
| TestCalledUnionsOfDissimilarTyeshaveGoodDisplay | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where did TestQualifyModuleTypeNames go?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm running these tests again to check |
||
| TestCloduleTypeOf1 | ||
| TestCodeCompletionEscaping | ||
| TestCodeFixAddParameterNames1 | ||
|
|
@@ -338,7 +337,6 @@ TestNoQuickInfoForLabel | |
| TestNoQuickInfoInWhitespace | ||
| TestOverloadQuickInfo | ||
| TestProtoVarVisibleWithOuterScopeUnderscoreProto | ||
| TestQualifyModuleTypeNames | ||
| TestQuickfixImplementInterfaceUnreachableTypeUsesRelativeImport | ||
| TestQuickInfo_notInsideComment | ||
| TestQuickinfo01 | ||
|
|
||
34 changes: 34 additions & 0 deletions
34
internal/fourslash/tests/manual/jsDocDontBreakWithNamespacesVS_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package fourslash_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/microsoft/typescript-go/internal/fourslash" | ||
| "github.com/microsoft/typescript-go/internal/lsp/lsproto" | ||
| "github.com/microsoft/typescript-go/internal/testutil" | ||
| ) | ||
|
|
||
| func TestJsDocDontBreakWithNamespacesVS(t *testing.T) { | ||
| t.Parallel() | ||
| defer testutil.RecoverAndFail(t, "Panic on fourslash test") | ||
| const content = `// @allowJs: true | ||
| // @Filename: jsDocDontBreakWithNamespaces.js | ||
| /** | ||
| * @returns {module:@nodefuel/web~Webserver~wsServer#hello} Websocket server object | ||
| */ | ||
| function foo() { } | ||
| foo(''/*foo*/); | ||
|
|
||
| /** | ||
| * @type {module:xxxxx} */ | ||
| */ | ||
| function bar() { } | ||
| bar(''/*bar*/); | ||
|
|
||
| /** @type {function(module:xxxx, module:xxxx): module:xxxxx} */ | ||
| function zee() { } | ||
| zee(''/*zee*/);` | ||
| f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) | ||
| defer done() | ||
| f.VerifyBaselineSignatureHelp(t) | ||
| } |
32 changes: 32 additions & 0 deletions
32
internal/fourslash/tests/manual/jsDocFunctionSignatures5VS_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package fourslash_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/microsoft/typescript-go/internal/fourslash" | ||
| "github.com/microsoft/typescript-go/internal/lsp/lsproto" | ||
| "github.com/microsoft/typescript-go/internal/testutil" | ||
| ) | ||
|
|
||
| func TestJsDocFunctionSignatures5VS(t *testing.T) { | ||
| t.Parallel() | ||
| defer testutil.RecoverAndFail(t, "Panic on fourslash test") | ||
| const content = `// @strict: true | ||
| // @allowJs: true | ||
| // @Filename: Foo.js | ||
| /** | ||
| * Filters a path based on a regexp or glob pattern. | ||
| * @param {String} basePath The base path where the search will be performed. | ||
| * @param {String} pattern A string defining a regexp of a glob pattern. | ||
| * @param {String} type The search pattern type, can be a regexp or a glob. | ||
| * @param {Object} options A object containing options to the search. | ||
| * @return {Array} A list containing the filtered paths. | ||
| */ | ||
| function pathFilter(basePath, pattern, type, options){ | ||
| //... | ||
| } | ||
| pathFilter(/**/'foo', 'bar', 'baz', {});` | ||
| f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) | ||
| defer done() | ||
| f.VerifyBaselineSignatureHelp(t) | ||
| } |
27 changes: 27 additions & 0 deletions
27
internal/fourslash/tests/manual/jsDocFunctionSignatures6VS_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package fourslash_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/microsoft/typescript-go/internal/fourslash" | ||
| "github.com/microsoft/typescript-go/internal/lsp/lsproto" | ||
| "github.com/microsoft/typescript-go/internal/testutil" | ||
| ) | ||
|
|
||
| func TestJsDocFunctionSignatures6VS(t *testing.T) { | ||
| t.Parallel() | ||
| defer testutil.RecoverAndFail(t, "Panic on fourslash test") | ||
| const content = `// @allowJs: true | ||
| // @Filename: Foo.js | ||
| /** | ||
| * @param {string} p1 - A string param | ||
| * @param {string?} p2 - An optional param | ||
| * @param {string} [p3] - Another optional param | ||
| * @param {string} [p4="test"] - An optional param with a default value | ||
| */ | ||
| function f1(p1, p2, p3, p4){} | ||
| f1(/*1*/'foo', /*2*/'bar', /*3*/'baz', /*4*/'qux');` | ||
| f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) | ||
| defer done() | ||
| f.VerifyBaselineSignatureHelp(t) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package fourslash_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/microsoft/typescript-go/internal/fourslash" | ||
| "github.com/microsoft/typescript-go/internal/lsp/lsproto" | ||
| "github.com/microsoft/typescript-go/internal/testutil" | ||
| ) | ||
|
|
||
| func TestJsdocReturnsTagVS(t *testing.T) { | ||
| t.Parallel() | ||
| defer testutil.RecoverAndFail(t, "Panic on fourslash test") | ||
| const content = `// @allowJs: true | ||
| // @Filename: dummy.js | ||
| /** | ||
| * Find an item | ||
| * @template T | ||
| * @param {T[]} l | ||
| * @param {T} x | ||
| * @returns {?T} The names of the found item(s). | ||
| */ | ||
| function find(l, x) { | ||
| } | ||
| find(''/**/);` | ||
| f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) | ||
| defer done() | ||
| f.VerifyBaselineSignatureHelp(t) | ||
| } |
42 changes: 42 additions & 0 deletions
42
internal/fourslash/tests/manual/quickInfoJsDocTags13VS_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package fourslash_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/microsoft/typescript-go/internal/fourslash" | ||
| "github.com/microsoft/typescript-go/internal/lsp/lsproto" | ||
| "github.com/microsoft/typescript-go/internal/testutil" | ||
| ) | ||
|
|
||
| func TestQuickInfoJsDocTags13VS(t *testing.T) { | ||
| t.Parallel() | ||
| defer testutil.RecoverAndFail(t, "Panic on fourslash test") | ||
| const content = `// @allowJs: true | ||
| // @checkJs: true | ||
| // @filename: ./a.js | ||
| /** | ||
| * First overload | ||
| * @overload | ||
| * @param {number} a | ||
| * @returns {void} | ||
| */ | ||
|
|
||
| /** | ||
| * Second overload | ||
| * @overload | ||
| * @param {string} a | ||
| * @returns {void} | ||
| */ | ||
|
|
||
| /** | ||
| * @param {string | number} a | ||
| * @returns {void} | ||
| */ | ||
| function f(a) {} | ||
|
|
||
| f(/*a*/1); | ||
| f(/*b*/"");` | ||
| f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) | ||
| defer done() | ||
| f.VerifyBaselineSignatureHelp(t) | ||
| } |
58 changes: 58 additions & 0 deletions
58
internal/fourslash/tests/manual/quickInfoJsDocTextFormatting1VS_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| package fourslash_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/microsoft/typescript-go/internal/fourslash" | ||
| "github.com/microsoft/typescript-go/internal/lsp/lsproto" | ||
| "github.com/microsoft/typescript-go/internal/testutil" | ||
| ) | ||
|
|
||
| func TestQuickInfoJsDocTextFormatting1VS(t *testing.T) { | ||
| t.Parallel() | ||
| defer testutil.RecoverAndFail(t, "Panic on fourslash test") | ||
| const content = `/** | ||
| * @param {number} var1 **Highlighted text** | ||
| * @param {string} var2 Another **Highlighted text** | ||
| */ | ||
| function f1(var1, var2) { } | ||
|
|
||
| /** | ||
| * @param {number} var1 *Regular text with an asterisk | ||
| * @param {string} var2 Another *Regular text with an asterisk | ||
| */ | ||
| function f2(var1, var2) { } | ||
|
|
||
| /** | ||
| * @param {number} var1 | ||
| * *Regular text with an asterisk | ||
| * @param {string} var2 | ||
| * Another *Regular text with an asterisk | ||
| */ | ||
| function f3(var1, var2) { } | ||
|
|
||
| /** | ||
| * @param {number} var1 | ||
| * **Highlighted text** | ||
| * @param {string} var2 | ||
| * Another **Highlighted text** | ||
| */ | ||
| function f4(var1, var2) { } | ||
|
|
||
| /** | ||
| * @param {number} var1 | ||
| **Highlighted text** | ||
| * @param {string} var2 | ||
| Another **Highlighted text** | ||
| */ | ||
| function f5(var1, var2) { } | ||
|
|
||
| f1(/*1*/); | ||
| f2(/*2*/); | ||
| f3(/*3*/); | ||
| f4(/*4*/); | ||
| f5(/*5*/);` | ||
| f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) | ||
| defer done() | ||
| f.VerifyBaselineSignatureHelp(t) | ||
| } |
21 changes: 21 additions & 0 deletions
21
internal/fourslash/tests/manual/signatureHelpAfterParameterVS_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package fourslash_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/microsoft/typescript-go/internal/fourslash" | ||
| "github.com/microsoft/typescript-go/internal/lsp/lsproto" | ||
| "github.com/microsoft/typescript-go/internal/testutil" | ||
| ) | ||
|
|
||
| func TestSignatureHelpAfterParameterVS(t *testing.T) { | ||
| t.Parallel() | ||
| defer testutil.RecoverAndFail(t, "Panic on fourslash test") | ||
| const content = `type Type = (a, b, c) => void | ||
| const a: Type = (a/*1*/, b/*2*/) => {} | ||
| const b: Type = function (a/*3*/, b/*4*/) {} | ||
| const c: Type = ({ /*5*/a: { b/*6*/ }}/*7*/ = { }/*8*/, [b/*9*/]/*10*/, .../*11*/c/*12*/) => {}` | ||
| f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) | ||
| defer done() | ||
| f.VerifyBaselineSignatureHelp(t) | ||
| } |
20 changes: 20 additions & 0 deletions
20
internal/fourslash/tests/manual/signatureHelpAnonymousTypeVS_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package fourslash_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/microsoft/typescript-go/internal/fourslash" | ||
| "github.com/microsoft/typescript-go/internal/lsp/lsproto" | ||
| "github.com/microsoft/typescript-go/internal/testutil" | ||
| ) | ||
|
|
||
| func TestSignatureHelpAnonymousTypeVS(t *testing.T) { | ||
| t.Parallel() | ||
| defer testutil.RecoverAndFail(t, "Panic on fourslash test") | ||
| const content = `const comparers: Array<(a: any, b: any) => boolean> = []; | ||
|
|
||
| comparers.push((a,/**/ b) => true);` | ||
| f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) | ||
| defer done() | ||
| f.VerifyBaselineSignatureHelp(t) | ||
| } |
67 changes: 67 additions & 0 deletions
67
internal/fourslash/tests/manual/signatureHelpBindingPatternVS_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| package fourslash_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/microsoft/typescript-go/internal/fourslash" | ||
| "github.com/microsoft/typescript-go/internal/lsp/lsproto" | ||
| "github.com/microsoft/typescript-go/internal/testutil" | ||
| ) | ||
|
|
||
| func TestSignatureHelpBindingPatternVS(t *testing.T) { | ||
| t.Parallel() | ||
| defer testutil.RecoverAndFail(t, "Panic on fourslash test") | ||
| const content = ` | ||
| /** | ||
| * @param options An empty object binding pattern. | ||
| */ | ||
| function emptyObj({}) {} | ||
| emptyObj(/*emptyObj*/) | ||
|
|
||
| /** | ||
| * @param items An empty array binding pattern. | ||
| */ | ||
| function emptyArr([]) {} | ||
| emptyArr(/*emptyArr*/) | ||
|
|
||
| /** | ||
| * @param param An object with a and b properties. | ||
| */ | ||
| function nonEmptyObj({a, b}: {a: number, b: string}) {} | ||
| nonEmptyObj(/*nonEmptyObj*/) | ||
|
|
||
| /** | ||
| * @param tuple A tuple with two elements. | ||
| */ | ||
| function nonEmptyArr([x, y]: [number, string]) {} | ||
| nonEmptyArr(/*nonEmptyArr*/) | ||
|
|
||
| /** | ||
| * @param first The first number parameter. | ||
| * @param second An object with a and b properties. | ||
| */ | ||
| function idLeading(first: number, {a, b}: {a: number, b: string}) {} | ||
| idLeading(123/*idLeading*/, { a: 1, b: 2 }/*bindingTrailing*/) | ||
|
|
||
| /** | ||
| * @param first An object with a and b properties. | ||
| * @param last The last number parameter. | ||
| */ | ||
| function bindingLeading({a, b}: {a: number, b: string}, last: number) {} | ||
| bindingLeading(/*bindingLeading*/{ a: 1, b: 2 }, 123 /*idTrailing*/) | ||
|
|
||
| /** | ||
| * @param param1 {Object} The first parameter | ||
| * @param param1.a {number} Comment a | ||
| * @param param1.b {string} Comment b | ||
| * @param param2 {Object} The second parameter | ||
| * @param param2.c {boolean} Comment c | ||
| * @param param2.d {unknown} Comment d | ||
| */ | ||
| function multipleBindings({ a, b }, { c, d }) {} | ||
| multipleBindings({ a: 0, b: "" }/*firstObjParam*/, { c: true, d: "" }/*secondObjParam*/) | ||
| ` | ||
| f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) | ||
| defer done() | ||
| f.VerifyBaselineSignatureHelp(t) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.