mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 06:41:59 -06:00
Emit error codes when reporting diagnostics.
Addresses part of issue #506.
This commit is contained in:
parent
16d1cfd29d
commit
07d56898ee
@ -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[]) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user