File tree Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,37 @@ export class StandardTags {
328
328
standardization : Standardization . Extended
329
329
} ) ;
330
330
331
+ /**
332
+ * (Extended)
333
+ *
334
+ * Used to document another symbol or resource that may be related to the current item being documented.
335
+ *
336
+ * @remarks
337
+ *
338
+ * For example:
339
+ *
340
+ * ```ts
341
+ * /**
342
+ * * Both of these will link to the bar function.
343
+ * * @see {@link bar }
344
+ * * @see bar
345
+ * */
346
+ * function foo() {}
347
+
348
+ * // Use the inline {@link } tag to include a link within a free-form description.
349
+ * /**
350
+ * * @see {@link foo } for further information.
351
+ * * @see {@link http://github.com|GitHub }
352
+ * */
353
+ * function bar() {}
354
+ * ```
355
+ */
356
+ public static readonly see : TSDocTagDefinition = StandardTags . _defineTag ( {
357
+ tagName : '@see' ,
358
+ syntaxKind : TSDocTagSyntaxKind . BlockTag ,
359
+ standardization : Standardization . Extended
360
+ } ) ;
361
+
331
362
/**
332
363
* (Extended)
333
364
*
@@ -420,6 +451,7 @@ export class StandardTags {
420
451
StandardTags . remarks ,
421
452
StandardTags . returns ,
422
453
StandardTags . sealed ,
454
+ StandardTags . see ,
423
455
StandardTags . throws ,
424
456
StandardTags . typeParam ,
425
457
StandardTags . virtual
Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ export class TSDocEmitter {
130
130
docComment . typeParams ,
131
131
docComment . returnsBlock ,
132
132
...docComment . customBlocks ,
133
+ ...docComment . seeBlocks ,
133
134
docComment . inheritDocTag
134
135
] ) ;
135
136
if ( docComment . modifierTagSet . nodes . length > 0 ) {
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ export class DocComment extends DocNode {
87
87
*/
88
88
public readonly modifierTagSet : StandardModifierTagSet ;
89
89
90
+ private _seeBlocks : DocBlock [ ] ;
90
91
private _customBlocks : DocBlock [ ] ;
91
92
92
93
/**
@@ -106,6 +107,7 @@ export class DocComment extends DocNode {
106
107
107
108
this . modifierTagSet = new StandardModifierTagSet ( ) ;
108
109
110
+ this . _seeBlocks = [ ]
109
111
this . _customBlocks = [ ] ;
110
112
}
111
113
@@ -114,13 +116,27 @@ export class DocComment extends DocNode {
114
116
return DocNodeKind . Comment ;
115
117
}
116
118
119
+ /**
120
+ * The collection of all `@see` DockBlockTag nodes belonging to this doc comment.
121
+ */
122
+ public get seeBlocks ( ) : ReadonlyArray < DocBlock > {
123
+ return this . _seeBlocks ;
124
+ }
125
+
117
126
/**
118
127
* The collection of all DocBlock nodes belonging to this doc comment.
119
128
*/
120
129
public get customBlocks ( ) : ReadonlyArray < DocBlock > {
121
130
return this . _customBlocks ;
122
131
}
123
132
133
+ /**
134
+ * Append an item to the seeBlocks collection.
135
+ */
136
+ public appendSeeBlock ( block : DocBlock ) : void {
137
+ this . _seeBlocks . push ( block ) ;
138
+ }
139
+
124
140
/**
125
141
* Append an item to the customBlocks collection.
126
142
*/
@@ -139,6 +155,7 @@ export class DocComment extends DocNode {
139
155
this . typeParams . count > 0 ? this . typeParams : undefined ,
140
156
this . returnsBlock ,
141
157
...this . customBlocks ,
158
+ ...this . seeBlocks ,
142
159
this . inheritDocTag ,
143
160
...this . modifierTagSet . nodes
144
161
] ;
Original file line number Diff line number Diff line change @@ -329,6 +329,9 @@ export class NodeParser {
329
329
case StandardTags . returns . tagNameWithUpperCase :
330
330
docComment . returnsBlock = block ;
331
331
break ;
332
+ case StandardTags . see . tagNameWithUpperCase :
333
+ docComment . appendSeeBlock ( block ) ;
334
+ break ;
332
335
default :
333
336
docComment . appendCustomBlock ( block ) ;
334
337
}
You can’t perform that action at this time.
0 commit comments