Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/building/suggested.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,16 @@ This can be inconvenient for two reasons:
artifacts due to conflicting compiler flags or other settings, forcing
additional rebuilds in some cases.

To avoid these problems:
- Add `--build-dir=build-rust-analyzer` to all of the custom `x` commands in
your editor's rust-analyzer configuration.
(Feel free to choose a different directory name if desired.)
- Modify the `rust-analyzer.rustfmt.overrideCommand` setting so that it points
to the copy of `rustfmt` in that other build directory.
- Modify the `rust-analyzer.procMacro.server` setting so that it points to the
copy of `rust-analyzer-proc-macro-srv` in that other build directory.
To avoid these problems, use the editor configuration generated by
`./x setup editor`. These configuration files already set up the
rust-analyzer build directory and the matching `rustfmt` and proc-macro server
paths for each supported editor.

If you maintain a custom editor configuration, copy the relevant settings from
the files in `src/etc`, such as [`src/etc/rust_analyzer_settings.json`],
[`src/etc/rust_analyzer_eglot.el`], [`src/etc/rust_analyzer_helix.toml`], or
[`src/etc/rust_analyzer_zed.json`], rather than duplicating them from this
guide.

Using separate build directories for command-line builds and rust-analyzer
requires extra disk space.
Expand Down
Loading