Make docComment template indent whitespace-only

This commit is contained in:
Arthur Ozga
2017-03-08 12:41:20 -08:00
parent 1bf4f06b2a
commit b7d09ef015
3 changed files with 11 additions and 9 deletions

View File

@@ -178,7 +178,8 @@ namespace ts.JsDoc {
const posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position);
const lineStart = sourceFile.getLineStarts()[posLineAndChar.line];
const indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character);
// replace non-whitespace characters in prefix with spaces.
const indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, () => " ");
const isJavaScriptFile = hasJavaScriptFileExtension(sourceFile.fileName);
let docParams = "";