CR feedback to use template strings.

This commit is contained in:
Cyrus Najmabadi 2015-02-19 15:52:37 -08:00
parent cdc1b90e42
commit 990bbb2dce
3 changed files with 4 additions and 4 deletions

View File

@ -88,11 +88,11 @@ module ts {
if (diagnostic.file) {
var loc = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
output += diagnostic.file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + "): ";
output += `${ diagnostic.file.fileName }(${ loc.line + 1 },${ loc.character + 1 }): `;
}
var category = DiagnosticCategory[diagnostic.category].toLowerCase();
output += category + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, sys.newLine) + sys.newLine;
output += `${ category } TS${ diagnostic.code }: ${ flattenDiagnosticMessageText(diagnostic.messageText, sys.newLine) }${ sys.newLine }`;
sys.write(output);
}

View File

@ -114,7 +114,7 @@ module ts {
export function nodePosToString(node: Node): string {
var file = getSourceFileOfNode(node);
var loc = getLineAndCharacterOfPosition(file, node.pos);
return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")";
return `${ file.fileName }(${ loc.line + 1 },${ loc.character + 1 })`;
}
export function getStartPosOfNode(node: Node): number {

View File

@ -396,7 +396,7 @@ module FourSlash {
var lineStarts = ts.computeLineStarts(this.getFileContent(this.activeFile.fileName));
var lineCharPos = ts.computeLineAndCharacterOfPosition(lineStarts, pos);
this.scenarioActions.push('<MoveCaretToLineAndChar LineNumber="' + (lineCharPos.line + 1) + '" CharNumber="' + (lineCharPos.character + 1) + '" />');
this.scenarioActions.push(`<MoveCaretToLineAndChar LineNumber=${ lineCharPos.line + 1 } CharNumber=${ lineCharPos.character + 1 } />`);
}
public moveCaretRight(count = 1) {