-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Correctly resolve tags for function overloads #30253
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0a1090d
Correctly resolve tags for function overloads. Fixes #30181
jeanp413 4896dba
Merge branch 'master' into fix-quick-info-wrong-tag
jeanp413 04e33bf
Better fix for #30181. Added more unit tests
jeanp413 0a0bfff
Merge remote-tracking branch 'upstream/master' into fix-quick-info-wr…
jeanp413 d97a0bd
Fix commentsOverloads tests
jeanp413 376acad
Fallback to first signature when doc and tags are empty
jeanp413 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 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
62 changes: 62 additions & 0 deletions
62
tests/cases/fourslash/quickInfoJsDocTagsFunctionOverload.ts
This file contains 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,62 @@ | ||
/// <reference path='fourslash.ts'/> | ||
|
||
// @Filename: quickInfoJsDocTagsFunctionOverload.ts | ||
////declare function /*1*/foo(): void; | ||
//// | ||
/////** | ||
//// * @tag Tag text | ||
//// */ | ||
////declare function /*2*/foo(x: number): void | ||
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. this test is a good start.
|
||
|
||
goTo.marker("1"); | ||
verify.verifyQuickInfoDisplayParts( | ||
"function", | ||
"declare", | ||
{ start: 17, length: 3 }, | ||
[ | ||
{text:"function",kind:"keyword"}, | ||
{text:" ",kind:"space"}, | ||
{text:"foo",kind:"functionName"}, | ||
{text:"(",kind:"punctuation"}, | ||
{text:")",kind:"punctuation"}, | ||
{text:":",kind:"punctuation"}, | ||
{text:" ",kind:"space"}, | ||
{text:"void",kind:"keyword"}, | ||
{text:" ",kind:"space"}, | ||
{text:"(",kind:"punctuation"}, | ||
{text:"+",kind:"operator"}, | ||
{text:"1",kind:"numericLiteral"}, | ||
{text:" ",kind:"space"}, | ||
{text:"overload",kind:"text"}, | ||
{text:")",kind:"punctuation"} | ||
], | ||
[]); | ||
|
||
goTo.marker("2"); | ||
verify.verifyQuickInfoDisplayParts( | ||
"function", | ||
"declare", | ||
{ start: 73, length: 3 }, | ||
[ | ||
{text:"function",kind:"keyword"}, | ||
{text:" ",kind:"space"}, | ||
{text:"foo",kind:"functionName"}, | ||
{text:"(",kind:"punctuation"}, | ||
{text:"x",kind:"parameterName"}, | ||
{text:":",kind:"punctuation"}, | ||
{text:" ",kind:"space"}, | ||
{text:"number",kind:"keyword"}, | ||
{text:")",kind:"punctuation"}, | ||
{text:":",kind:"punctuation"}, | ||
{text:" ",kind:"space"}, | ||
{text:"void",kind:"keyword"}, | ||
{text:" ",kind:"space"}, | ||
{text:"(",kind:"punctuation"}, | ||
{text:"+",kind:"operator"}, | ||
{text:"1",kind:"numericLiteral"}, | ||
{text:" ",kind:"space"}, | ||
{text:"overload",kind:"text"}, | ||
{text:")",kind:"punctuation"} | ||
], | ||
[], | ||
[{ name: "tag", text: "Tag text" }]); |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should add the same code here.