Skip to content

Commit e175595

Browse files
committed
Auto merge of rust-lang#15186 - matklad:panic, r=HKalbasi
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: rust-lang#14977
2 parents ff485b6 + 832a64e commit e175595

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

editors/code/package.json

+10
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,16 @@
339339
"default": null,
340340
"markdownDescription": "Environment variables passed to the runnable launched using `Test` or `Debug` lens or `rust-analyzer.run` command."
341341
},
342+
"rust-analyzer.runnables.problemMatcher": {
343+
"type": "array",
344+
"items": {
345+
"type": "string"
346+
},
347+
"default": [
348+
"$rustc"
349+
],
350+
"markdownDescription": "Problem matchers to use for `rust-analyzer.run` command, eg `[\"$rustc\", \"$rust-panic\"]`."
351+
},
342352
"rust-analyzer.server.path": {
343353
"type": [
344354
"null",

editors/code/src/config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ export class Config {
220220
return this.get<string[] | undefined>("discoverProjectCommand");
221221
}
222222

223+
get problemMatcher(): string[] {
224+
return this.get<string[]>("runnables.problemMatcher") || [];
225+
}
226+
223227
get cargoRunner() {
224228
return this.get<string | undefined>("cargoRunner");
225229
}

editors/code/src/run.ts

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export async function createTask(runnable: ra.Runnable, config: Config): Promise
151151
definition,
152152
runnable.label,
153153
args,
154+
config.problemMatcher,
154155
config.cargoRunner,
155156
true
156157
);

editors/code/src/tasks.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class CargoTaskProvider implements vscode.TaskProvider {
4646
{ type: TASK_TYPE, command: def.command },
4747
`cargo ${def.command}`,
4848
[def.command],
49+
this.config.problemMatcher,
4950
this.config.cargoRunner
5051
);
5152
vscodeTask.group = def.group;
@@ -70,6 +71,7 @@ class CargoTaskProvider implements vscode.TaskProvider {
7071
definition,
7172
task.name,
7273
args,
74+
this.config.problemMatcher,
7375
this.config.cargoRunner
7476
);
7577
}
@@ -83,6 +85,7 @@ export async function buildCargoTask(
8385
definition: CargoTaskDefinition,
8486
name: string,
8587
args: string[],
88+
problemMatcher: string[],
8689
customRunner?: string,
8790
throwOnError: boolean = false
8891
): Promise<vscode.Task> {
@@ -128,7 +131,7 @@ export async function buildCargoTask(
128131
name,
129132
TASK_SOURCE,
130133
exec,
131-
["$rustc", "$rust-panic"]
134+
problemMatcher
132135
);
133136
}
134137

0 commit comments

Comments
 (0)