You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: manual.adoc
+23-10
Original file line number
Diff line number
Diff line change
@@ -535,12 +535,6 @@ https://docs.helix-editor.com/[Helix] supports LSP by default.
535
535
However, it won't install `rust-analyzer` automatically.
536
536
You can follow instructions for installing <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
537
537
538
-
=== Crates
539
-
540
-
There is a package named `ra_ap_rust_analyzer` available on https://crates.io/crates/ra_ap_rust-analyzer[crates.io], for someone who wants to use it programmatically.
541
-
542
-
For more details, see https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/publish.yml[the publish workflow].
543
-
544
538
=== Visual Studio 2022
545
539
546
540
There are multiple rust-analyzer extensions for Visual Studio 2022 on Windows:
* Supports all editions of Visual Studio 2022 on Windows: Community, Professional, or Enterprise
579
573
574
+
=== Lapce
575
+
576
+
https://lapce.dev/[Lapce] has a Rust plugin which you can install directly.
577
+
Unfortunately, it downloads an old version of `rust-analyzer`, but you can set the server path under Settings.
578
+
579
+
=== Crates
580
+
581
+
There is a package named `ra_ap_rust_analyzer` available on https://crates.io/crates/ra_ap_rust-analyzer[crates.io], for someone who wants to use it programmatically.
582
+
583
+
For more details, see https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/publish.yml[the publish workflow].
584
+
580
585
== Troubleshooting
581
586
582
587
Start with looking at the rust-analyzer version.
@@ -768,14 +773,18 @@ See https://github.com/rust-analyzer/rust-project.json-example for a small examp
768
773
769
774
You can set the `RA_LOG` environment variable to `rust_analyzer=info` to inspect how rust-analyzer handles config and project loading.
770
775
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.
776
+
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.
777
+
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.
778
+
As an example, the following configuration explicitly sets `cargo check` as the `check` command.
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.
785
+
`check.overrideCommand` requires the command specified to output json error messages for rust-analyzer to consume.
786
+
The `--message-format=json` flag does this for `cargo check` so whichever command you use must also output errors in this format.
787
+
See the <<Configuration>> section for more information.
While most errors and warnings provided by rust-analyzer come from the `cargo check` integration, there's a growing number of diagnostics implemented using rust-analyzer's own analysis.
817
826
Some of these diagnostics don't respect `\#[allow]` or `\#[deny]` attributes yet, but can be turned off using the `rust-analyzer.diagnostics.enable`, `rust-analyzer.diagnostics.experimental.enable` or `rust-analyzer.diagnostics.disabled` settings.
818
827
828
+
=== Clippy
829
+
830
+
To run `cargo clippy` instead of `cargo check`, you can set `"rust-analyzer.check.command": "clippy"`.
831
+
819
832
include::./generated_diagnostic.adoc[]
820
833
821
834
== Editor Features
@@ -948,7 +961,7 @@ Also note that a full runnable name is something like *run bin_or_example_name*,
948
961
949
962
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.
950
963
951
-
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.
964
+
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.
952
965
953
966
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`:
* pr:14098[] (first contribution) add support for `DidChangeWorkspaceFolders` notifications.
13
+
* pr:13991[] add an "Add braces" assist:
14
+
+
15
+
image::https://user-images.githubusercontent.com/4973437/213783924-7c8a8ab5-6a52-4d80-837c-cf2a9b56f061.gif["Screen recording showing an assist that adds braces around the bodies of a closure and a `match` arm"]
16
+
* pr:14087[], pr:14094[] support computing layout of RPIT.
17
+
* pr:13986[] add a setting to limit the number of completions.
0 commit comments