Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 5147b2a

Browse files
committed
Fix styling of syntax errors
Since we were previously specifying the message type to be `syntax error`, Linter didn't have a pre-defined style for the messages. Move to just using `Error`, which Linter will style for us.
1 parent 55392a4 commit 5147b2a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/main.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ export default {
5151
let match = regex.exec(output);
5252
while (match !== null) {
5353
const msgLine = Number.parseInt(match[1] - 1, 10);
54+
const type = match[2] === 'warning' ? 'Warning' : 'Error';
5455
toReturn.push({
5556
range: helpers.rangeFromLineNumber(textEditor, msgLine),
56-
type: match[2],
57+
type,
5758
text: match[3],
5859
filePath,
5960
});

spec/linter-ruby-spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ describe('The Ruby provider for Linter', () => {
4343
lint(editor).then((messages) => {
4444
expect(messages.length).toBe(2);
4545

46-
expect(messages[0].type).toBe('warning');
46+
expect(messages[0].type).toBe('Warning');
4747
expect(messages[0].html).not.toBeDefined();
4848
expect(messages[0].text).toBe('assigned but unused variable - payload');
4949
expect(messages[0].filePath).toBe(badPath);
5050
expect(messages[0].range).toEqual([[1, 2], [1, 13]]);
5151

52-
expect(messages[1].type).toBe('syntax error');
52+
expect(messages[1].type).toBe('Error');
5353
expect(messages[1].html).not.toBeDefined();
5454
expect(messages[1].text).toBe('unexpected keyword_end, expecting end-of-input');
5555
expect(messages[1].filePath).toBe(badPath);

0 commit comments

Comments
 (0)