Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--docs/user/manual.adoc6
-rw-r--r--editors/code/package.json2
-rw-r--r--editors/code/src/config.ts4
-rw-r--r--editors/code/src/debug.ts2
-rw-r--r--editors/code/src/run.ts2
5 files changed, 8 insertions, 8 deletions
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc
index 5a4078f16f..bd924031e0 100644
--- a/docs/user/manual.adoc
+++ b/docs/user/manual.adoc
@@ -933,17 +933,17 @@ For example:
More about `when` clause contexts https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts[here].
==== Setting runnable environment variables
-You can use "rust-analyzer.runnableEnv" setting to define runnable environment-specific substitution variables.
+You can use "rust-analyzer.runnables.extraEnv" setting to define runnable environment-specific substitution variables.
The simplest way for all runnables in a bunch:
```jsonc
-"rust-analyzer.runnableEnv": {
+"rust-analyzer.runnables.extraEnv": {
"RUN_SLOW_TESTS": "1"
}
```
Or it is possible to specify vars more granularly:
```jsonc
-"rust-analyzer.runnableEnv": [
+"rust-analyzer.runnables.extraEnv": [
{
// "mask": null, // null mask means that this rule will be applied for all runnables
env: {
diff --git a/editors/code/package.json b/editors/code/package.json
index 2ab45fa142..a905de2c6b 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -311,7 +311,7 @@
"default": null,
"description": "Custom cargo runner extension ID."
},
- "rust-analyzer.runnableEnv": {
+ "rust-analyzer.runnables.extraEnv": {
"anyOf": [
{
"type": "null"
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index c6d2bcc2b2..ee9ba7465a 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -224,8 +224,8 @@ export class Config {
return this.get<string | undefined>("cargoRunner");
}
- get runnableEnv() {
- const item = this.get<any>("runnableEnv");
+ get runnablesExtraEnv() {
+ const item = this.get<any>("runnables.extraEnv") ?? this.get<any>("runnableEnv");
if (!item) return item;
const fixRecord = (r: Record<string, any>) => {
for (const key in r) {
diff --git a/editors/code/src/debug.ts b/editors/code/src/debug.ts
index cffee1de6a..8fbd427039 100644
--- a/editors/code/src/debug.ts
+++ b/editors/code/src/debug.ts
@@ -118,7 +118,7 @@ async function getDebugConfiguration(
return path.normalize(p).replace(wsFolder, "${workspaceFolder" + workspaceQualifier + "}");
}
- const env = prepareEnv(runnable, ctx.config.runnableEnv);
+ const env = prepareEnv(runnable, ctx.config.runnablesExtraEnv);
const executable = await getDebugExecutable(runnable, env);
let sourceFileMap = debugOptions.sourceFileMap;
if (sourceFileMap === "auto") {
diff --git a/editors/code/src/run.ts b/editors/code/src/run.ts
index 623fb10295..cc2ecfa2d8 100644
--- a/editors/code/src/run.ts
+++ b/editors/code/src/run.ts
@@ -140,7 +140,7 @@ export async function createTask(runnable: ra.Runnable, config: Config): Promise
command: args[0], // run, test, etc...
args: args.slice(1),
cwd: runnable.args.workspaceRoot || ".",
- env: prepareEnv(runnable, config.runnableEnv),
+ env: prepareEnv(runnable, config.runnablesExtraEnv),
overrideCargo: runnable.args.overrideCargo,
};