Skip to content

Commit a2bc57c

Browse files
author
Dorian Peake
authored
Update manual.adoc
1 parent aae1e97 commit a2bc57c

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

docs/user/manual.adoc

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -616,23 +616,11 @@ See https://github.com/rust-analyzer/rust-project.json-example for a small examp
616616

617617
You can set `RA_LOG` environmental variable to `rust_analyzer=info` to inspect how rust-analyzer handles config and project loading.
618618

619-
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. The following example, explicitly enables calls to `cargo check` in neovim's configuration:
619+
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.
620620

621-
[source,vim]
621+
[source,json]
622622
----
623-
lua << EOF
624-
nvim_lsp['rust_analyzer'].setup {
625-
on_attach = on_attach,
626-
settings = {
627-
["rust-analyzer"] = {
628-
checkOnSave = {
629-
overrideCommand = {"cargo", "check", "--message-format=json"},
630-
enable = true,
631-
}
632-
}
633-
}
634-
}
635-
EOF
623+
{ "rust-analyzer.checkOnSave.overrideCommand": ["cargo", "check", "--message-format=json"] }
636624
----
637625

638626
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.

0 commit comments

Comments
 (0)