Skip to content

Commit f21075e

Browse files
committed
don't color the entire file when there is EOF exception
1 parent c315956 commit f21075e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/clojureLintingProvider.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ export class ClojureLintingProvider {
114114
if(result.err) {
115115
const errData = result['err-data'];
116116
if(document.fileName.endsWith(errData.data.file)) {
117+
const startLine = errData.data.line - 1;
118+
const startChar = errData.data.column - 1;
119+
const endLine = errData.data['end-line'] == null ? startLine : errData.data['end-line'] - 1;
120+
const endChar = errData.data['end-column'] == null ? startChar : errData.data['end-column'] - 1;
117121
warnings.push({
118-
range: new Range(errData.data.line - 1, errData.data.column - 1, errData.data['end-line'] - 1, errData.data['end-column'] - 1),
122+
range: new Range(errData.data.line - 1, errData.data.column - 1, endLine, endChar),
119123
message: errData.cause,
120124
source: "Linter Exception",
121125
severity: vscode.DiagnosticSeverity.Error,

0 commit comments

Comments
 (0)