Unify padding impls and consistently use them

This commit is contained in:
Wesley Wigham
2020-02-19 17:21:51 -08:00
parent 77d3a69039
commit 4a34294908
4 changed files with 16 additions and 23 deletions

View File

@@ -383,13 +383,6 @@ namespace ts {
return formatStyle + text + resetEscapeSequence;
}
function padLeft(s: string, length: number) {
while (s.length < length) {
s = " " + s;
}
return s;
}
function formatCodeSpan(file: SourceFile, start: number, length: number, indent: string, squiggleColor: ForegroundColorEscapeSequences, host: FormatDiagnosticsHost) {
const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file, start);
const { line: lastLine, character: lastLineChar } = getLineAndCharacterOfPosition(file, start + length);