Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Redirect errors to our own console #38

Merged
merged 1 commit into from
Dec 10, 2020
Merged
Changes from all 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
7 changes: 3 additions & 4 deletions src/features/vsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ export default class ValeServerProvider implements vscode.CodeActionProvider {
} else if (configLocation !== "") {
stylesPath = [
binaryLocation,
"--no-exit",
"--output=JSON",
"--config",
configLocation,
"ls-config",
];
} else {
stylesPath = [binaryLocation, "--no-exit", "ls-config"];
stylesPath = [binaryLocation, "--output=JSON", "ls-config"];
}

const configOut = await utils.runInWorkspace(folder, stylesPath);
Expand All @@ -103,7 +103,7 @@ export default class ValeServerProvider implements vscode.CodeActionProvider {
const stdout = await utils.runInWorkspace(folder, command);
this.handleJSON(stdout.toString(), file, 0);
} catch (error) {
vscode.window.showErrorMessage(`[Vale]: ${error}`);
this.logger.appendLine(error);
}
}

Expand All @@ -114,7 +114,6 @@ export default class ValeServerProvider implements vscode.CodeActionProvider {
) {
const diagnostics: vscode.Diagnostic[] = [];
const backend = this.useCLI ? "Vale" : "Vale Server";

let body = JSON.parse(contents.toString());
if (body.Code && body.Text) {
this.logger.appendLine(body.Text);
Expand Down