Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/linter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as cp from 'child_process';
import * as vscode from 'vscode';
import * as util from 'util';
import * as path from 'path';

import { ProtoError, parseProtoError } from './protoError';

Expand Down Expand Up @@ -42,7 +41,7 @@ export default class Linter {
}

let currentFile = this.codeDocument.uri.fsPath;
let currentDirectory = path.dirname(currentFile);
let wsRoot = vscode.workspace.workspaceFolders[0].uri.path

let protoLintPath = vscode.workspace.getConfiguration('protolint').get<string>('path');
if (!protoLintPath) {
Expand All @@ -59,7 +58,7 @@ export default class Linter {
let lintResults: string = "";

await exec(cmd, {
cwd: currentDirectory
cwd: wsRoot
}).catch((error: any) => lintResults = error.stderr);

return lintResults;
Expand Down