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 {
280280 let pos = this . pos ;
281281 const useJSDocScanner = this . kind >= SyntaxKind . FirstJSDocTagNode && this . kind <= SyntaxKind . LastJSDocTagNode ;
282282 const processNode = ( node : Node ) => {
283- if ( pos < node . pos ) {
283+ const isJSDocTagNode = isJSDocTag ( node ) ;
284+ if ( ! isJSDocTagNode && pos < node . pos ) {
284285 pos = this . addSyntheticNodes ( children , pos , node . pos , useJSDocScanner ) ;
285286 }
286287 children . push ( node ) ;
287- pos = node . end ;
288+ if ( ! isJSDocTagNode ) {
289+ pos = node . end ;
290+ }
288291 } ;
289292 const processNodes = ( nodes : NodeArray < Node > ) => {
290293 if ( pos < nodes . pos ) {
@@ -299,10 +302,6 @@ namespace ts {
299302 processNode ( jsDocComment ) ;
300303 }
301304 }
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 ;
306305 forEachChild ( this , processNode , processNodes ) ;
307306 if ( pos < this . end ) {
308307 this . addSyntheticNodes ( children , pos , this . end ) ;
You can’t perform that action at this time.
0 commit comments