From 832a64e290ce97e6ae9fce3743dc2f38c4088ccd Mon Sep 17 00:00:00 2001 From: Alex Kladov Date: Fri, 30 Jun 2023 22:18:52 +0100 Subject: feat: don't add panics to error jump list by default To re-enable this, use "rust-analyzer.runnables.problemMatcher": [ "$rustc", "$rust-panic" ], setting. closes: #14977 --- editors/code/src/config.ts | 4 ++++ editors/code/src/run.ts | 1 + editors/code/src/tasks.ts | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'editors/code/src') diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index ee9ba7465ab..15a1d4e0f1d 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -220,6 +220,10 @@ export class Config { return this.get("discoverProjectCommand"); } + get problemMatcher(): string[] { + return this.get("runnables.problemMatcher") || []; + } + get cargoRunner() { return this.get("cargoRunner"); } diff --git a/editors/code/src/run.ts b/editors/code/src/run.ts index cc2ecfa2d80..bdd85243133 100644 --- a/editors/code/src/run.ts +++ b/editors/code/src/run.ts @@ -151,6 +151,7 @@ export async function createTask(runnable: ra.Runnable, config: Config): Promise definition, runnable.label, args, + config.problemMatcher, config.cargoRunner, true ); diff --git a/editors/code/src/tasks.ts b/editors/code/src/tasks.ts index d6509d9aa6e..efb889dc797 100644 --- a/editors/code/src/tasks.ts +++ b/editors/code/src/tasks.ts @@ -46,6 +46,7 @@ class CargoTaskProvider implements vscode.TaskProvider { { type: TASK_TYPE, command: def.command }, `cargo ${def.command}`, [def.command], + this.config.problemMatcher, this.config.cargoRunner ); vscodeTask.group = def.group; @@ -70,6 +71,7 @@ class CargoTaskProvider implements vscode.TaskProvider { definition, task.name, args, + this.config.problemMatcher, this.config.cargoRunner ); } @@ -83,6 +85,7 @@ export async function buildCargoTask( definition: CargoTaskDefinition, name: string, args: string[], + problemMatcher: string[], customRunner?: string, throwOnError: boolean = false ): Promise { @@ -128,7 +131,7 @@ export async function buildCargoTask( name, TASK_SOURCE, exec, - ["$rustc", "$rust-panic"] + problemMatcher ); } -- cgit 1.4.1-3-g733a5