Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 8f617b5

Browse files
committed
Update some old checkOnSave references
1 parent cfeec8a commit 8f617b5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/user/manual.adoc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -768,14 +768,18 @@ See https://github.com/rust-analyzer/rust-project.json-example for a small examp
768768

769769
You can set the `RA_LOG` environment variable to `rust_analyzer=info` to inspect how rust-analyzer handles config and project loading.
770770

771-
Note that calls to `cargo check` are disabled when using `rust-project.json` by default, so compilation errors and warnings will no longer be sent to your LSP client. To enable these compilation errors you will need to specify explicitly what command rust-analyzer should run to perform the checks using the `checkOnSave.overrideCommand` configuration. As an example, the following configuration explicitly sets `cargo check` as the `checkOnSave` command.
771+
Note that calls to `cargo check` are disabled when using `rust-project.json` by default, so compilation errors and warnings will no longer be sent to your LSP client.
772+
To enable these compilation errors you will need to specify explicitly what command rust-analyzer should run to perform the checks using the `rust-analyzer.check.overrideCommand` configuration.
773+
As an example, the following configuration explicitly sets `cargo check` as the `check` command.
772774

773775
[source,json]
774776
----
775-
{ "rust-analyzer.checkOnSave.overrideCommand": ["cargo", "check", "--message-format=json"] }
777+
{ "rust-analyzer.check.overrideCommand": ["cargo", "check", "--message-format=json"] }
776778
----
777779

778-
The `checkOnSave.overrideCommand` requires the command specified to output json error messages for rust-analyzer to consume. The `--message-format=json` flag does this for `cargo check` so whichever command you use must also output errors in this format. See the <<Configuration>> section for more information.
780+
`check.overrideCommand` requires the command specified to output json error messages for rust-analyzer to consume.
781+
The `--message-format=json` flag does this for `cargo check` so whichever command you use must also output errors in this format.
782+
See the <<Configuration>> section for more information.
779783

780784
== Security
781785

@@ -952,7 +956,7 @@ Also note that a full runnable name is something like *run bin_or_example_name*,
952956

953957
Instead of relying on the built-in `cargo check`, you can configure Code to run a command in the background and use the `$rustc-watch` problem matcher to generate inline error markers from its output.
954958

955-
To do this you need to create a new https://code.visualstudio.com/docs/editor/tasks[VS Code Task] and set `rust-analyzer.checkOnSave.enable: false` in preferences.
959+
To do this you need to create a new https://code.visualstudio.com/docs/editor/tasks[VS Code Task] and set `"rust-analyzer.checkOnSave": false` in preferences.
956960

957961
For example, if you want to run https://crates.io/crates/cargo-watch[`cargo watch`] instead, you might add the following to `.vscode/tasks.json`:
958962

0 commit comments

Comments
 (0)