Skip to content

Commit

Permalink
Unrolled build for rust-lang#132794
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#132794 - WaffleLapkin:helix-improved-config, r=jieyouxu

Use a separate dir for r-a builds consistently in helix config

r? `@jieyouxu`
cc `@mrkajetanp`

Previously config used `build-rust-analyzer` for rustfmt and proc macros server, while not using it for actual `x check` commands.

This PR:
- Replaces the build dir with `build/rust-analyzer`
  - This is just my preference
  - Although I do think this is the nicest option: the directory is already git-ignored, `rm -fr ./build` removes everything, etc
- Uses said directory with the `x check` commands in helix r-a config
- Adds instructions on how to build rustfmt and proc macro server to the config

As of note, this is not what other configs do (like vscode's), however this _is_ what I would actually suggest to people (and what I'm actually using).
  • Loading branch information
rust-timer authored Nov 9, 2024
2 parents 4b198d6 + 2206968 commit 8757b42
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/etc/rust_analyzer_helix.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# This config uses a separate build directory for rust-analyzer,
# so that r-a's checks don't block user `x` commands and vice-verse.
# R-a's build directory is located in `build/rust-analyzer`.
#
# To build rustfmt and proc macro server for r-a run the following command:
# ```
# x b proc-macro-srv-cli rustfmt --stage 0 --build-dir build/rust-analyzer
# ```

[language-server.rust-analyzer.config]
linkedProjects = [
"Cargo.toml",
Expand All @@ -17,16 +26,18 @@ overrideCommand = [
"x.py",
"check",
"--json-output",
"--build-dir",
"build/rust-analyzer",
]

[language-server.rust-analyzer.config.rustfmt]
overrideCommand = [
"build-rust-analyzer/host/rustfmt/bin/rustfmt",
"build/rust-analyzer/host/rustfmt/bin/rustfmt",
"--edition=2021"
]

[language-server.rust-analyzer.config.procMacro]
server = "build-rust-analyzer/host/stage0/libexec/rust-analyzer-proc-macro-srv"
server = "build/rust-analyzer/host/stage0/libexec/rust-analyzer-proc-macro-srv"
enable = true

[language-server.rust-analyzer.config.rustc]
Expand All @@ -47,4 +58,6 @@ overrideCommand = [
"x.py",
"check",
"--json-output",
"--build-dir",
"build/rust-analyzer",
]

0 comments on commit 8757b42

Please sign in to comment.