Skip to content

Commit d7f4c21

Browse files
committed
Auto merge of rust-lang#15138 - mohsen-alizadeh:13583-rename-runnableEnv-to-runnables-extraEnv, r=Veykril
13583 rename runnable env to runnables extra env closes rust-lang#13583
2 parents ad434fc + 3f70117 commit d7f4c21

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

docs/user/manual.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -933,17 +933,17 @@ For example:
933933
More about `when` clause contexts https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts[here].
934934

935935
==== Setting runnable environment variables
936-
You can use "rust-analyzer.runnableEnv" setting to define runnable environment-specific substitution variables.
936+
You can use "rust-analyzer.runnables.extraEnv" setting to define runnable environment-specific substitution variables.
937937
The simplest way for all runnables in a bunch:
938938
```jsonc
939-
"rust-analyzer.runnableEnv": {
939+
"rust-analyzer.runnables.extraEnv": {
940940
"RUN_SLOW_TESTS": "1"
941941
}
942942
```
943943

944944
Or it is possible to specify vars more granularly:
945945
```jsonc
946-
"rust-analyzer.runnableEnv": [
946+
"rust-analyzer.runnables.extraEnv": [
947947
{
948948
// "mask": null, // null mask means that this rule will be applied for all runnables
949949
env: {

editors/code/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311
"default": null,
312312
"description": "Custom cargo runner extension ID."
313313
},
314-
"rust-analyzer.runnableEnv": {
314+
"rust-analyzer.runnables.extraEnv": {
315315
"anyOf": [
316316
{
317317
"type": "null"

editors/code/src/config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ export class Config {
224224
return this.get<string | undefined>("cargoRunner");
225225
}
226226

227-
get runnableEnv() {
228-
const item = this.get<any>("runnableEnv");
227+
get runnablesExtraEnv() {
228+
const item = this.get<any>("runnables.extraEnv") ?? this.get<any>("runnableEnv");
229229
if (!item) return item;
230230
const fixRecord = (r: Record<string, any>) => {
231231
for (const key in r) {

editors/code/src/debug.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ async function getDebugConfiguration(
118118
return path.normalize(p).replace(wsFolder, "${workspaceFolder" + workspaceQualifier + "}");
119119
}
120120

121-
const env = prepareEnv(runnable, ctx.config.runnableEnv);
121+
const env = prepareEnv(runnable, ctx.config.runnablesExtraEnv);
122122
const executable = await getDebugExecutable(runnable, env);
123123
let sourceFileMap = debugOptions.sourceFileMap;
124124
if (sourceFileMap === "auto") {

editors/code/src/run.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export async function createTask(runnable: ra.Runnable, config: Config): Promise
140140
command: args[0], // run, test, etc...
141141
args: args.slice(1),
142142
cwd: runnable.args.workspaceRoot || ".",
143-
env: prepareEnv(runnable, config.runnableEnv),
143+
env: prepareEnv(runnable, config.runnablesExtraEnv),
144144
overrideCargo: runnable.args.overrideCargo,
145145
};
146146

0 commit comments

Comments
 (0)