Skip to content

Commit

Permalink
--vscode option
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Nov 8, 2024
1 parent 78380de commit 307bdbb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,11 @@
"default": true,
"description": "Disable ANSI formatting."
},
"juvix-mode.vscodeErrors": {
"type": "boolean",
"default": true,
"description": "Enable VSCode compatible error formatting."
},
"juvix-mode.showNameIds": {
"type": "boolean",
"default": false,
Expand Down
5 changes: 5 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ export class JuvixConfig {
return this.workspaceConfig.get('noColors', true);
}

public vscodeErrors(): boolean {
return this.workspaceConfig.get('vscodeErrors', true);
}

public showNameIds(): boolean {
return this.workspaceConfig.get('showNameIds', false);
}
Expand Down Expand Up @@ -160,6 +164,7 @@ export class JuvixConfig {
public getGlobalFlags(): string {
const flags: string[] = [];
if (this.noColors()) flags.push('--no-colors');
if (this.vscodeErrors()) flags.push('--vscode');
if (this.showNameIds()) flags.push('--show-name-ids');
if (this.noTermination()) flags.push('--no-termination');
if (this.noPositivity()) flags.push('--no-positivity');
Expand Down
1 change: 1 addition & 0 deletions src/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function activate(_context: vscode.ExtensionContext) {
// this is the way to protect from unexpected behaviour of the `format` command
return stdout !== '' ? [vscode.TextEdit.replace(range, stdout)] : [];
} else {
// TODO: this should be parsed with the problem matcher
const errMsg: string = res.stderr.toString();
logger.warn(errMsg);
return [];
Expand Down

0 comments on commit 307bdbb

Please sign in to comment.