Skip to content

Commit 4d25f7f

Browse files
committed
add tests
1 parent 46fb1c3 commit 4d25f7f

File tree

2 files changed

+185
-9
lines changed

2 files changed

+185
-9
lines changed

tests/baselines/reference/quickInfoInheritDoc.baseline

Lines changed: 165 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[
22
{
33
"marker": {
4-
"fileName": "/tests/cases/fourslash/quickInfoJsDocTags7.ts",
5-
"position": 629,
4+
"fileName": "/tests/cases/fourslash/quickInfoInheritDoc.ts",
5+
"position": 817,
66
"name": "1"
77
},
88
"quickInfo": {
99
"kind": "method",
1010
"kindModifiers": "public,static",
1111
"textSpan": {
12-
"start": 629,
12+
"start": 817,
1313
"length": 17
1414
},
1515
"displayParts": [
@@ -187,15 +187,159 @@
187187
},
188188
{
189189
"marker": {
190-
"fileName": "/tests/cases/fourslash/quickInfoJsDocTags7.ts",
191-
"position": 869,
190+
"fileName": "/tests/cases/fourslash/quickInfoInheritDoc.ts",
191+
"position": 1143,
192192
"name": "2"
193193
},
194+
"quickInfo": {
195+
"kind": "method",
196+
"kindModifiers": "public,static",
197+
"textSpan": {
198+
"start": 1143,
199+
"length": 5
200+
},
201+
"displayParts": [
202+
{
203+
"text": "(",
204+
"kind": "punctuation"
205+
},
206+
{
207+
"text": "method",
208+
"kind": "text"
209+
},
210+
{
211+
"text": ")",
212+
"kind": "punctuation"
213+
},
214+
{
215+
"text": " ",
216+
"kind": "space"
217+
},
218+
{
219+
"text": "SubClass",
220+
"kind": "className"
221+
},
222+
{
223+
"text": ".",
224+
"kind": "punctuation"
225+
},
226+
{
227+
"text": "func1",
228+
"kind": "methodName"
229+
},
230+
{
231+
"text": "(",
232+
"kind": "punctuation"
233+
},
234+
{
235+
"text": "stuff1",
236+
"kind": "parameterName"
237+
},
238+
{
239+
"text": ":",
240+
"kind": "punctuation"
241+
},
242+
{
243+
"text": " ",
244+
"kind": "space"
245+
},
246+
{
247+
"text": "any",
248+
"kind": "keyword"
249+
},
250+
{
251+
"text": ")",
252+
"kind": "punctuation"
253+
},
254+
{
255+
"text": ":",
256+
"kind": "punctuation"
257+
},
258+
{
259+
"text": " ",
260+
"kind": "space"
261+
},
262+
{
263+
"text": "void",
264+
"kind": "keyword"
265+
}
266+
],
267+
"documentation": [
268+
{
269+
"text": "BaseClass.func1",
270+
"kind": "text"
271+
}
272+
],
273+
"tags": [
274+
{
275+
"name": "param",
276+
"text": [
277+
{
278+
"text": "stuff1",
279+
"kind": "parameterName"
280+
},
281+
{
282+
"text": " ",
283+
"kind": "space"
284+
},
285+
{
286+
"text": "BaseClass.func1.stuff1",
287+
"kind": "text"
288+
}
289+
]
290+
},
291+
{
292+
"name": "returns",
293+
"text": [
294+
{
295+
"text": "BaseClass.func1.returns",
296+
"kind": "text"
297+
}
298+
]
299+
},
300+
{
301+
"name": "inheritDoc"
302+
},
303+
{
304+
"name": "param",
305+
"text": [
306+
{
307+
"text": "stuff1",
308+
"kind": "parameterName"
309+
},
310+
{
311+
"text": " ",
312+
"kind": "space"
313+
},
314+
{
315+
"text": "SubClass.func1.stuff1",
316+
"kind": "text"
317+
}
318+
]
319+
},
320+
{
321+
"name": "returns",
322+
"text": [
323+
{
324+
"text": "SubClass.func1.returns",
325+
"kind": "text"
326+
}
327+
]
328+
}
329+
]
330+
}
331+
},
332+
{
333+
"marker": {
334+
"fileName": "/tests/cases/fourslash/quickInfoInheritDoc.ts",
335+
"position": 1282,
336+
"name": "3"
337+
},
194338
"quickInfo": {
195339
"kind": "property",
196340
"kindModifiers": "public,static",
197341
"textSpan": {
198-
"start": 869,
342+
"start": 1282,
199343
"length": 12
200344
},
201345
"displayParts": [
@@ -244,11 +388,25 @@
244388
{
245389
"text": "Applicable description always.",
246390
"kind": "text"
391+
},
392+
{
393+
"text": "\n",
394+
"kind": "lineBreak"
395+
},
396+
{
397+
"text": "text over tag",
398+
"kind": "text"
247399
}
248400
],
249401
"tags": [
250402
{
251-
"name": "inheritDoc"
403+
"name": "inheritDoc",
404+
"text": [
405+
{
406+
"text": "text after tag",
407+
"kind": "text"
408+
}
409+
]
252410
}
253411
]
254412
}

tests/cases/fourslash/quickInfoInheritDoc.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @noEmit: true
44
// @allowJs: true
55

6-
// @Filename: quickInfoJsDocTags7.ts
6+
// @Filename: quickInfoInheritDoc.ts
77
////abstract class BaseClass {
88
//// /**
99
//// * Useful description always applicable
@@ -15,6 +15,14 @@
1515
//// }
1616
////
1717
//// /**
18+
//// * BaseClass.func1
19+
//// * @param {any} stuff1 BaseClass.func1.stuff1
20+
//// * @returns {void} BaseClass.func1.returns
21+
//// */
22+
//// public static func1(stuff1: any): void {
23+
//// }
24+
////
25+
//// /**
1826
//// * Applicable description always.
1927
//// */
2028
//// public static readonly someProperty: string = 'general value';
@@ -40,8 +48,18 @@
4048
////
4149
//// /**
4250
//// * @inheritDoc
51+
//// * @param {any} stuff1 SubClass.func1.stuff1
52+
//// * @returns {void} SubClass.func1.returns
53+
//// */
54+
//// public static /*2*/func1(stuff1: any): void {
55+
//// }
56+
////
57+
//// /**
58+
//// * text over tag
59+
//// * @inheritDoc
60+
//// * text after tag
4361
//// */
44-
//// public static readonly /*2*/someProperty: string = 'specific to this class value'
62+
//// public static readonly /*3*/someProperty: string = 'specific to this class value'
4563
////}
4664

4765
verify.baselineQuickInfo();

0 commit comments

Comments
 (0)