mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-07 14:34:35 -06:00
Respond to PR comments
This commit is contained in:
parent
0a61334677
commit
9daa800c6a
@ -31,9 +31,9 @@ namespace ts {
|
||||
scanJsxToken(): SyntaxKind;
|
||||
scanJSDocToken(): SyntaxKind;
|
||||
scan(): SyntaxKind;
|
||||
getText(): string;
|
||||
// Sets the text for the scanner to scan. An optional subrange starting point and length
|
||||
// can be provided to have the scanner only scan a portion of the text.
|
||||
getText(): string;
|
||||
setText(text: string, start?: number, length?: number): void;
|
||||
setOnError(onError: ErrorCallback): void;
|
||||
setScriptTarget(scriptTarget: ScriptTarget): void;
|
||||
|
||||
@ -282,22 +282,13 @@ namespace ts.formatting {
|
||||
}
|
||||
|
||||
function skipToEndOf(node: Node): void {
|
||||
scanner.setTextPos(backUpWhitespace());
|
||||
scanner.setTextPos(node.end);
|
||||
savedPos = scanner.getStartPos();
|
||||
lastScanAction = undefined;
|
||||
lastTokenInfo = undefined;
|
||||
wasNewLine = false;
|
||||
leadingTrivia = undefined;
|
||||
trailingTrivia = undefined;
|
||||
|
||||
function backUpWhitespace(): number {
|
||||
const text = scanner.getText();
|
||||
let end = node.end;
|
||||
while (end > 0 && isWhiteSpaceLike(text.charCodeAt(end - 1))) {
|
||||
end--;
|
||||
}
|
||||
return end;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user