Skip to content

Commit 43cf71b

Browse files
committed
add tests
1 parent a08fd6c commit 43cf71b

4 files changed

Lines changed: 141 additions & 1 deletion

File tree

tests/baselines/reference/quickInfoJsDocTags14.baseline

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// /* @param newA - new a param
55
// */
66
// function foo({ a: newA }: { a: string }) {
7+
// ^
8+
// | ----------------------------------------------------------------------
9+
// | (property) a: string
10+
// | ----------------------------------------------------------------------
711
// newA
812
// ^^^^
913
// | ----------------------------------------------------------------------
@@ -14,6 +18,56 @@
1418
// }
1519

1620
[
21+
{
22+
"marker": {
23+
"fileName": "/tests/cases/fourslash/quickInfoJsDocTags14.ts",
24+
"position": 74,
25+
"name": ""
26+
},
27+
"item": {
28+
"kind": "property",
29+
"kindModifiers": "",
30+
"textSpan": {
31+
"start": 74,
32+
"length": 1
33+
},
34+
"displayParts": [
35+
{
36+
"text": "(",
37+
"kind": "punctuation"
38+
},
39+
{
40+
"text": "property",
41+
"kind": "text"
42+
},
43+
{
44+
"text": ")",
45+
"kind": "punctuation"
46+
},
47+
{
48+
"text": " ",
49+
"kind": "space"
50+
},
51+
{
52+
"text": "a",
53+
"kind": "propertyName"
54+
},
55+
{
56+
"text": ":",
57+
"kind": "punctuation"
58+
},
59+
{
60+
"text": " ",
61+
"kind": "space"
62+
},
63+
{
64+
"text": "string",
65+
"kind": "keyword"
66+
}
67+
],
68+
"documentation": []
69+
}
70+
},
1771
{
1872
"marker": {
1973
"fileName": "/tests/cases/fourslash/quickInfoJsDocTags14.ts",
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
=== /a.js ===
2+
// /**
3+
// * @param {string} a - a param
4+
// /* @param newA - new a param
5+
// */
6+
// function foo({ a: newA }) {
7+
// newA
8+
// ^^^^
9+
// | ----------------------------------------------------------------------
10+
// | (parameter) newA: string
11+
// | - a param
12+
// | /*
13+
// | ----------------------------------------------------------------------
14+
// }
15+
16+
[
17+
{
18+
"marker": {
19+
"fileName": "/a.js",
20+
"position": 104,
21+
"name": ""
22+
},
23+
"item": {
24+
"kind": "parameter",
25+
"kindModifiers": "",
26+
"textSpan": {
27+
"start": 100,
28+
"length": 4
29+
},
30+
"displayParts": [
31+
{
32+
"text": "(",
33+
"kind": "punctuation"
34+
},
35+
{
36+
"text": "parameter",
37+
"kind": "text"
38+
},
39+
{
40+
"text": ")",
41+
"kind": "punctuation"
42+
},
43+
{
44+
"text": " ",
45+
"kind": "space"
46+
},
47+
{
48+
"text": "newA",
49+
"kind": "parameterName"
50+
},
51+
{
52+
"text": ":",
53+
"kind": "punctuation"
54+
},
55+
{
56+
"text": " ",
57+
"kind": "space"
58+
},
59+
{
60+
"text": "string",
61+
"kind": "keyword"
62+
}
63+
],
64+
"documentation": [
65+
{
66+
"text": "- a param\n/*",
67+
"kind": "text"
68+
}
69+
]
70+
}
71+
}
72+
]

tests/cases/fourslash/quickInfoJsDocTags14.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//// * @param a - a param
55
/////* @param newA - new a param
66
//// */
7-
////function foo({ a: newA }: { a: string }) {
7+
////function foo({ /**/a: newA }: { a: string }) {
88
//// newA/*1*/
99
////}
1010

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @noEmit: true
4+
// @allowJs: true
5+
// @filename: /a.js
6+
/////**
7+
//// * @param {string} a - a param
8+
/////* @param newA - new a param
9+
//// */
10+
////function foo({ a: newA }) {
11+
//// newA/**/
12+
////}
13+
14+
verify.baselineQuickInfo();

0 commit comments

Comments
 (0)