File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ namespace ts {
3131 scanJsxToken ( ) : SyntaxKind ;
3232 scanJSDocToken ( ) : SyntaxKind ;
3333 scan ( ) : SyntaxKind ;
34+ getText ( ) : string ;
3435 // Sets the text for the scanner to scan. An optional subrange starting point and length
3536 // can be provided to have the scanner only scan a portion of the text.
36- getText ( ) : string ;
3737 setText ( text : string , start ?: number , length ?: number ) : void ;
3838 setOnError ( onError : ErrorCallback ) : void ;
3939 setScriptTarget ( scriptTarget : ScriptTarget ) : void ;
Original file line number Diff line number Diff line change @@ -282,22 +282,13 @@ namespace ts.formatting {
282282 }
283283
284284 function skipToEndOf ( node : Node ) : void {
285- scanner . setTextPos ( backUpWhitespace ( ) ) ;
285+ scanner . setTextPos ( node . end ) ;
286286 savedPos = scanner . getStartPos ( ) ;
287287 lastScanAction = undefined ;
288288 lastTokenInfo = undefined ;
289289 wasNewLine = false ;
290290 leadingTrivia = undefined ;
291291 trailingTrivia = undefined ;
292-
293- function backUpWhitespace ( ) : number {
294- const text = scanner . getText ( ) ;
295- let end = node . end ;
296- while ( end > 0 && isWhiteSpaceLike ( text . charCodeAt ( end - 1 ) ) ) {
297- end -- ;
298- }
299- return end ;
300- }
301292 }
302293 }
303294}
You can’t perform that action at this time.
0 commit comments