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

Commit e05057c

Browse files
committed
Update for Linter 2.0 API
1 parent cf3ea35 commit e05057c

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

lib/init.js

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ const parseError = async (toParse, sourceFilePath) => {
109109
const projectPath = await elixirProjectPath(sourceFilePath);
110110
let reResult = re.exec(toParse);
111111
while (reResult !== null) {
112-
let text;
112+
let excerpt;
113113
let filePath;
114114
let range;
115115
if (reResult[2] !== undefined) {
116-
text = `(${reResult[1]}) ${reResult[2]}`;
116+
excerpt = `(${reResult[1]}) ${reResult[2]}`;
117117
filePath = join(projectPath, reResult[3]);
118118
const fileEditor = findTextEditor(filePath);
119119
if (fileEditor) {
@@ -126,7 +126,7 @@ const parseError = async (toParse, sourceFilePath) => {
126126
range = new Range([reResult[4] - 1, 0], [reResult[4] - 1, 1]);
127127
}
128128
} else {
129-
text = `(${reResult[1]}) ${reResult[7]}`;
129+
excerpt = `(${reResult[1]}) ${reResult[7]}`;
130130
filePath = join(projectPath, reResult[5]);
131131
const fileEditor = findTextEditor(filePath);
132132
if (fileEditor) {
@@ -136,10 +136,9 @@ const parseError = async (toParse, sourceFilePath) => {
136136
}
137137
}
138138
messages.push({
139-
type: 'Error',
140-
text,
141-
filePath,
142-
range,
139+
severity: 'error',
140+
excerpt: excerpt,
141+
location: { file: filePath, position: range },
143142
});
144143
reResult = re.exec(toParse);
145144
}
@@ -170,10 +169,9 @@ const parseWarning = async (toParse, sourceFilePath) => {
170169
range = new Range([reResult[3] - 1, 0], [reResult[3] - 1, 1]);
171170
}
172171
messages.push({
173-
type: 'Warning',
174-
text: reResult[1],
175-
filePath,
176-
range,
172+
severity: 'warning',
173+
excerpt: reResult[1],
174+
location: { file: filePath, position: range },
177175
});
178176
} catch (Error) {
179177
// eslint-disable-next-line no-console
@@ -209,10 +207,9 @@ const parseLegacyWarning = async (toParse, sourceFilePath) => {
209207
range = new Range([reResult[3] - 1, 0], [reResult[3] - 1, 1]);
210208
}
211209
messages.push({
212-
type: 'Warning',
213-
text: reResult[3],
214-
filePath,
215-
range,
210+
severity: 'warning',
211+
excerpt: reResult[3],
212+
location: { file: filePath, position: range },
216213
});
217214
} catch (Error) {
218215
// eslint-disable-next-line no-console
@@ -339,7 +336,7 @@ export default {
339336
return {
340337
grammarScopes: ['source.elixir'],
341338
scope: 'project',
342-
lintOnFly: false,
339+
lintsOnChange: false,
343340
name: 'Elixir',
344341
async lint(textEditor) {
345342
const filePath = textEditor.getPath();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"providedServices": {
3737
"linter": {
3838
"versions": {
39-
"1.0.0": "provideLinter"
39+
"2.0.0": "provideLinter"
4040
}
4141
}
4242
},

0 commit comments

Comments
 (0)