File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -280,11 +280,14 @@ namespace ts {
280
280
let pos = this . pos ;
281
281
const useJSDocScanner = this . kind >= SyntaxKind . FirstJSDocTagNode && this . kind <= SyntaxKind . LastJSDocTagNode ;
282
282
const processNode = ( node : Node ) => {
283
- if ( pos < node . pos ) {
283
+ const isJSDocTagNode = isJSDocTag ( node ) ;
284
+ if ( ! isJSDocTagNode && pos < node . pos ) {
284
285
pos = this . addSyntheticNodes ( children , pos , node . pos , useJSDocScanner ) ;
285
286
}
286
287
children . push ( node ) ;
287
- pos = node . end ;
288
+ if ( ! isJSDocTagNode ) {
289
+ pos = node . end ;
290
+ }
288
291
} ;
289
292
const processNodes = ( nodes : NodeArray < Node > ) => {
290
293
if ( pos < nodes . pos ) {
@@ -299,10 +302,6 @@ namespace ts {
299
302
processNode ( jsDocComment ) ;
300
303
}
301
304
}
302
- // For syntactic classifications, all trivia are classcified together, including jsdoc comments.
303
- // For that to work, the jsdoc comments should still be the leading trivia of the first child.
304
- // Restoring the scanner position ensures that.
305
- pos = this . pos ;
306
305
forEachChild ( this , processNode , processNodes ) ;
307
306
if ( pos < this . end ) {
308
307
this . addSyntheticNodes ( children , pos , this . end ) ;
You can’t perform that action at this time.
0 commit comments