Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Use cannonical file path for diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed May 2, 2017
1 parent bca4dd5 commit 08e9c10
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/goLiveErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ function processFile(e: vscode.TextDocumentChangeEvent) {
}
// extract the line, column and error message from the gotype output
let [_, file, line, column, message] = /^(.+):(\d+):(\d+):\s+(.+)/.exec(error);
// get cannonical file path
file = vscode.Uri.file(file).toString();
let range = new vscode.Range(+line - 1, +column, +line - 1, +column);
let diagnostic = new vscode.Diagnostic(range, message, vscode.DiagnosticSeverity.Error);

Expand All @@ -90,7 +92,7 @@ function processFile(e: vscode.TextDocumentChangeEvent) {
});

diagnosticMap.forEach((diagnostics, file) => {
errorDiagnosticCollection.set(vscode.Uri.parse('file://' + file), diagnostics);
errorDiagnosticCollection.set(vscode.Uri.parse(file), diagnostics);
});
}
});
Expand Down

0 comments on commit 08e9c10

Please sign in to comment.