File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1335,18 +1335,30 @@ namespace ts {
13351335 let position = 0 ;
13361336 // However we should still skip a pinned comment at the top
13371337 if ( ranges . length && ranges [ 0 ] . kind === SyntaxKind . MultiLineCommentTrivia && isPinnedComment ( text , ranges [ 0 ] ) ) {
1338- position = ranges [ 0 ] . end + 1 ;
1338+ position = ranges [ 0 ] . end ;
1339+ AdvancePastLineBreak ( ) ;
13391340 ranges = ranges . slice ( 1 ) ;
13401341 }
13411342 // As well as any triple slash references
13421343 for ( const range of ranges ) {
13431344 if ( range . kind === SyntaxKind . SingleLineCommentTrivia && isRecognizedTripleSlashComment ( node . text , range . pos , range . end ) ) {
1344- position = range . end + 1 ;
1345+ position = range . end ;
1346+ AdvancePastLineBreak ( ) ;
13451347 continue ;
13461348 }
13471349 break ;
13481350 }
13491351 return position ;
1352+
1353+ function AdvancePastLineBreak ( ) {
1354+ if ( text . charCodeAt ( position ) === 0xD ) {
1355+ position ++ ;
1356+ }
1357+
1358+ if ( text . charCodeAt ( position ) === 0xA ) {
1359+ position ++ ;
1360+ }
1361+ }
13501362 }
13511363
13521364 /**
You can’t perform that action at this time.
0 commit comments