Skip to content

Commit

Permalink
Fix to linter not working in web
Browse files Browse the repository at this point in the history
Signed-off-by: Liam Barry Allan <[email protected]>
  • Loading branch information
worksofliam committed Aug 3, 2022
1 parent 312d4ed commit f197e13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ function activate(context) {

if (languageEnabled) {
languageWorker = new LanguageWorker(context);
Output.write(`vscode-rpgle language tools enabled.`);
}

if (linterEnabled) {
linterWorker = new LinterWorker(context);
Output.write(`vscode-rpgle linter enabled.`);
}

registerColumnAssist(context);
Expand Down
5 changes: 3 additions & 2 deletions src/vscode/LinterWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const { Parser } = require(`../parser`);
const lintFile = {
member: `vscode,rpglint`,
streamfile: `.vscode/rpglint.json`,
file: `.vscode/rpglint.json`
file: `.vscode/rpglint.json`,
'vscode-vfs': `.vscode/rpglint.json`
};

module.exports = class LinterWorker {
Expand All @@ -39,7 +40,7 @@ module.exports = class LinterWorker {
const instance = getInstance();
const editor = vscode.window.activeTextEditor;

if (editor && editor.document.uri.scheme === `file`) {
if (editor && [`file`, `vscode-vfs`].includes(editor.document.uri.scheme)) {
const workspaces = vscode.workspace.workspaceFolders;
if (workspaces && workspaces.length > 0) {
const linter = await vscode.workspace.findFiles(`**/.vscode/rpglint.json`, null, 1);
Expand Down

0 comments on commit f197e13

Please sign in to comment.