about summary refs log tree commit diff
path: root/docs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-22 21:52:04 +0000
committerbors <bors@rust-lang.org>2022-10-22 21:52:04 +0000
commitb25f65739afe7b89cf9fdfdda52adef256bb0159 (patch)
tree53ef05ded9ec757a4aa1f567e0b6f2af016a5e38 /docs
parent19efa0b1103287ad521c0036c065ea2ebbe5939d (diff)
parent0f8904ec9cc0d26fda0164bc4a61f8e8ceb4d4ee (diff)
downloadrust-b25f65739afe7b89cf9fdfdda52adef256bb0159.tar.gz
rust-b25f65739afe7b89cf9fdfdda52adef256bb0159.zip
Auto merge of #13466 - Veykril:invocation-location, r=Veykril
Implement invocation location config

This allows setting the working directory for build-scripts on flycheck
Complements https://github.com/rust-lang/rust-analyzer/pull/13128

This will be followed up by one more PR that adds a few simple interpolation vars for `overrideCommand`, with that we should cover the needs for most build systems I believe.
Diffstat (limited to 'docs')
-rw-r--r--docs/user/generated_config.adoc30
1 files changed, 24 insertions, 6 deletions
diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc
index e5d4395c345..502833de72c 100644
--- a/docs/user/generated_config.adoc
+++ b/docs/user/generated_config.adoc
@@ -24,13 +24,22 @@ Automatically refresh project info via `cargo metadata` on
 --
 Run build scripts (`build.rs`) for more precise code analysis.
 --
+[[rust-analyzer.cargo.buildScripts.invocationLocation]]rust-analyzer.cargo.buildScripts.invocationLocation (default: `"workspace"`)::
++
+--
+Specifies the working directory for running build scripts.
+- "workspace": run build scripts for a workspace in the workspace's root directory.
+  This is incompatible with `#rust-analyzer.cargo.buildScripts.invocationStrategy#` set to `once`.
+- "root": run build scripts in the project's root directory.
+This config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`
+is set.
+--
 [[rust-analyzer.cargo.buildScripts.invocationStrategy]]rust-analyzer.cargo.buildScripts.invocationStrategy (default: `"per_workspace"`)::
 +
 --
 Specifies the invocation strategy to use when running the build scripts command.
-If `per_workspace` is set, the command will be executed for each workspace from the
-corresponding workspace root.
-If `once` is set, the command will be executed once in the project root.
+If `per_workspace` is set, the command will be executed for each workspace.
+If `once` is set, the command will be executed once.
 This config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`
 is set.
 --
@@ -128,13 +137,22 @@ List of features to activate. Defaults to
 
 Set to `"all"` to pass `--all-features` to Cargo.
 --
+[[rust-analyzer.checkOnSave.invocationLocation]]rust-analyzer.checkOnSave.invocationLocation (default: `"workspace"`)::
++
+--
+Specifies the working directory for running checks.
+- "workspace": run checks for workspaces in the corresponding workspaces' root directories.
+  This falls back to "root" if `#rust-analyzer.cargo.checkOnSave.invocationStrategy#` is set to `once`.
+- "root": run checks in the project's root directory.
+This config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`
+is set.
+--
 [[rust-analyzer.checkOnSave.invocationStrategy]]rust-analyzer.checkOnSave.invocationStrategy (default: `"per_workspace"`)::
 +
 --
 Specifies the invocation strategy to use when running the checkOnSave command.
-If `per_workspace` is set, the command will be executed for each workspace from the
-corresponding workspace root.
-If `once` is set, the command will be executed once in the project root.
+If `per_workspace` is set, the command will be executed for each workspace.
+If `once` is set, the command will be executed once.
 This config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`
 is set.
 --