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

Commit

Permalink
show rule name in errors
Browse files Browse the repository at this point in the history
  • Loading branch information
freewil committed Mar 16, 2019
1 parent bb94768 commit a162948
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions coffeelint-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,29 @@ documents.onDidChangeContent((change) => {
validateTextDocument(change.document);
});

function validateTextDocument(textDocument: ITextDocument): void {
function validateTextDocument(textDocument: ITextDocument): void {
let diagnostics: Diagnostic[] = [];
let text = textDocument.getText();
let issues = coffeeLint.lint(text, projectLintConfig);
for(var issue of issues) {
var severity;


if(issue.level === "warning") {
severity = DiagnosticSeverity.Warning;
} else if(issue.level === "error") {
} else if(issue.level === "error") {
severity = DiagnosticSeverity.Error;
}
else {
continue;
}

}
else {
continue;
}

diagnostics.push({
severity: severity,
range: {
start: {line:issue.lineNumber-1, character:0},
end: {line:issue.lineNumber-1, character:10000} // end of line, no cols in coffeelint
},
message: issue.message
message: issue.message + " (" + issue.rule + ")"
})
}

Expand Down

0 comments on commit a162948

Please sign in to comment.