|
| 1 | +# This config uses a separate build directory for rust-analyzer, |
| 2 | +# so that r-a's checks don't block user `x` commands and vice-verse. |
| 3 | +# R-a's build directory is located in `build/rust-analyzer`. |
| 4 | +# |
| 5 | +# To build rustfmt and proc macro server for r-a run the following command: |
| 6 | +# ``` |
| 7 | +# x b proc-macro-srv-cli rustfmt --stage 0 --build-dir build/rust-analyzer |
| 8 | +# ``` |
| 9 | + |
| 10 | +[language-server.rust-analyzer.config] |
| 11 | +linkedProjects = [ |
| 12 | + "Cargo.toml", |
| 13 | + "compiler/rustc_codegen_cranelift/Cargo.toml", |
| 14 | + "compiler/rustc_codegen_gcc/Cargo.toml", |
| 15 | + "library/Cargo.toml", |
| 16 | + "src/bootstrap/Cargo.toml", |
| 17 | + "src/tools/rust-analyzer/Cargo.toml", |
| 18 | +] |
| 19 | + |
| 20 | +[language-server.rust-analyzer.config.check] |
| 21 | +invocationLocation = "root" |
| 22 | +invocationStrategy = "once" |
| 23 | +overrideCommand = [ |
| 24 | + "./check.sh", |
| 25 | + "--json-output", |
| 26 | + "--build-dir", |
| 27 | + "build-rust-analyzer", |
| 28 | +] |
| 29 | + |
| 30 | +[language-server.rust-analyzer.config.rustfmt] |
| 31 | +overrideCommand = [ |
| 32 | + "build-rust-analyzer/host/rustfmt/bin/rustfmt", |
| 33 | + "--edition=2024" |
| 34 | +] |
| 35 | + |
| 36 | +[language-server.rust-analyzer.config.procMacro] |
| 37 | +server = "build-rust-analyzer/host/stage0/libexec/rust-analyzer-proc-macro-srv" |
| 38 | +enable = true |
| 39 | + |
| 40 | +[language-server.rust-analyzer.config.rustc] |
| 41 | +source = "./Cargo.toml" |
| 42 | + |
| 43 | +[language-server.rust-analyzer.config.cargo] |
| 44 | +sysrootSrc = "./library" |
| 45 | + |
| 46 | +[language-server.rust-analyzer.config.cargo.extraEnv] |
| 47 | +RUSTC_BOOTSTRAP = "1" |
| 48 | + |
| 49 | +[language-server.rust-analyzer.config.cargo.buildScripts] |
| 50 | +enable = true |
| 51 | +invocationLocation = "root" |
| 52 | +invocationStrategy = "once" |
| 53 | +overrideCommand = [ |
| 54 | + "./check.sh", |
| 55 | + "--json-output", |
| 56 | + "--build-dir", |
| 57 | + "build-rust-analyzer", |
| 58 | + "--compile-time-deps" |
| 59 | +] |
0 commit comments