@@ -30,27 +30,17 @@ import {
30
30
DocBlock
31
31
} from '@microsoft/tsdoc' ;
32
32
33
- export class Formatter {
34
- public static renderDocNode ( docNode : DocNode ) : string {
35
- let result : string = '' ;
36
- if ( docNode ) {
37
- if ( docNode instanceof DocExcerpt ) {
38
- result += docNode . content . toString ( ) ;
39
- }
40
- for ( const childNode of docNode . getChildNodes ( ) ) {
41
- result += Formatter . renderDocNode ( childNode ) ;
42
- }
33
+ export function renderDocNode ( docNode : DocNode ) {
34
+ let result : string = '' ;
35
+ if ( docNode ) {
36
+ if ( docNode instanceof DocExcerpt ) {
37
+ result += docNode . content . toString ( ) ;
43
38
}
44
- return result ;
45
- }
46
-
47
- public static renderDocNodes ( docNodes : ReadonlyArray < DocNode > ) : string {
48
- let result : string = '' ;
49
- for ( const docNode of docNodes ) {
50
- result += Formatter . renderDocNode ( docNode ) ;
39
+ for ( const childNode of docNode . getChildNodes ( ) ) {
40
+ result += renderDocNode ( childNode ) ;
51
41
}
52
- return result ;
53
42
}
43
+ return result ;
54
44
}
55
45
56
46
export function isArray ( type : Type ) {
@@ -157,7 +147,7 @@ export function getMainCommentOfNode(
157
147
node . getFullText ( )
158
148
) ;
159
149
const docComment : DocComment = parserContext . docComment ;
160
- return Formatter . renderDocNode ( docComment . summarySection ) . trim ( ) ;
150
+ return renderDocNode ( docComment . summarySection ) . trim ( ) ;
161
151
}
162
152
163
153
export function parseCommentDocValue ( docValue : string , type : ts . Type ) {
@@ -209,9 +199,7 @@ export function getTsDocTagsOfNode(node: Node, typeChecker: TypeChecker) {
209
199
const type = typeChecker . getTypeAtLocation ( node ) ;
210
200
if ( hasProperties ) {
211
201
blocks . forEach ( ( block ) => {
212
- const docValue = Formatter . renderDocNode ( block . content ) . split (
213
- '\n'
214
- ) [ 0 ] ;
202
+ const docValue = renderDocNode ( block . content ) . split ( '\n' ) [ 0 ] ;
215
203
const value = parseCommentDocValue ( docValue , type ) ;
216
204
217
205
if ( value !== null ) {
@@ -226,6 +214,11 @@ export function getTsDocTagsOfNode(node: Node, typeChecker: TypeChecker) {
226
214
tagResults [ tag ] = true ;
227
215
}
228
216
}
217
+ if ( docComment . remarksBlock ) {
218
+ tagResults [ 'remarks' ] = renderDocNode (
219
+ docComment . remarksBlock . content
220
+ ) . trim ( ) ;
221
+ }
229
222
if ( docComment . deprecatedBlock ) {
230
223
tagResults [ 'deprecated' ] = true ;
231
224
}
0 commit comments