Skip to content

Commit 156cb4c

Browse files
authored
Fix see tag quickinfo (microsoft#40458)
* Add test * Treat see tags same as param tags
1 parent 6be21fe commit 156cb4c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/services/jsDoc.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ namespace ts.JsDoc {
138138
case SyntaxKind.JSDocCallbackTag:
139139
case SyntaxKind.JSDocPropertyTag:
140140
case SyntaxKind.JSDocParameterTag:
141-
const { name } = tag as JSDocTypedefTag | JSDocPropertyTag | JSDocParameterTag;
141+
case SyntaxKind.JSDocSeeTag:
142+
const { name } = tag as JSDocTypedefTag | JSDocPropertyTag | JSDocParameterTag | JSDocSeeTag;
142143
return name ? withNode(name) : comment;
143144
default:
144145
return comment;

tests/baselines/reference/quickInfoJsDocTags.baseline

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
{
33
"marker": {
44
"fileName": "/tests/cases/fourslash/quickInfoJsDocTags.ts",
5-
"position": 272
5+
"position": 298
66
},
77
"quickInfo": {
88
"kind": "function",
99
"kindModifiers": "",
1010
"textSpan": {
11-
"start": 272,
11+
"start": 298,
1212
"length": 3
1313
},
1414
"displayParts": [
@@ -99,6 +99,10 @@
9999
{
100100
"name": "returns",
101101
"text": "The result"
102+
},
103+
{
104+
"name": "see",
105+
"text": "x (the parameter)"
102106
}
103107
]
104108
}

tests/cases/fourslash/quickInfoJsDocTags.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
//// * @property {number} x The prop
1212
//// * @param {number} x The param
1313
//// * @returns The result
14+
//// * @see x (the parameter)
1415
//// */
1516
////function /**/foo(x) {}
1617

0 commit comments

Comments
 (0)