diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index d355c49ab29..abefd6e4819 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -86,13 +86,18 @@ module ts { } function reportDiagnostic(diagnostic: Diagnostic) { + var output = ""; + if (diagnostic.file) { var loc = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start); - sys.write(diagnostic.file.filename + "(" + loc.line + "," + loc.character + "): " + diagnostic.messageText + sys.newLine); - } - else { - sys.write(diagnostic.messageText + sys.newLine); + + var output = diagnostic.file.filename + "(" + loc.line + "," + loc.character + "): "; } + + var category = DiagnosticCategory[diagnostic.category]; + output += category + " TS" + diagnostic.code + ": " + diagnostic.messageText + sys.newLine; + + sys.write(output); } function reportDiagnostics(diagnostics: Diagnostic[]) {