Skip to content

Commit befad8b

Browse files
committed
make rust-analyzer settings use dedicated directory
This avoids rust-analyzer having to wait for a build lock due to ./x running other commands (and the other way around). This was inspired by Helix settings.
1 parent 852f15c commit befad8b

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

src/etc/rust_analyzer_eglot.el

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
:overrideCommand ["python3"
77
"x.py"
88
"check"
9-
"--json-output"])
9+
"--json-output"
10+
"--build-dir"
11+
"build/rust-analyzer"])
1012
:linkedProjects ["Cargo.toml"
1113
"compiler/rustc_codegen_cranelift/Cargo.toml"
1214
"compiler/rustc_codegen_gcc/Cargo.toml"
@@ -23,7 +25,9 @@
2325
:overrideCommand ["python3"
2426
"x.py"
2527
"check"
26-
"--json-output"])
28+
"--json-output"
29+
"--build-dir"
30+
"build/rust-analyzer"])
2731
:sysrootSrc "./library"
2832
:extraEnv (:RUSTC_BOOTSTRAP "1"))
2933
:rustc ( :source "./Cargo.toml" )))))))

src/etc/rust_analyzer_settings.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"python3",
66
"x.py",
77
"check",
8-
"--json-output"
8+
"--json-output",
9+
"--build-dir",
10+
"build/rust-analyzer"
911
],
1012
"rust-analyzer.linkedProjects": [
1113
"Cargo.toml",
@@ -27,7 +29,9 @@
2729
"python3",
2830
"x.py",
2931
"check",
30-
"--json-output"
32+
"--json-output",
33+
"--build-dir",
34+
"build/rust-analyzer"
3135
],
3236
"rust-analyzer.cargo.sysrootSrc": "./library",
3337
"rust-analyzer.rustc.source": "./Cargo.toml",

src/etc/rust_analyzer_zed.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@
77
"enable": true,
88
"invocationLocation": "root",
99
"invocationStrategy": "once",
10-
"overrideCommand": ["python3", "x.py", "check", "--json-output"]
10+
"overrideCommand": [
11+
"python3",
12+
"x.py",
13+
"check",
14+
"--json-output",
15+
"--build-dir",
16+
"build/rust-analyzer"
17+
]
1118
},
1219
"extraEnv": {
1320
"RUSTC_BOOTSTRAP": "1"
@@ -17,7 +24,14 @@
1724
"check": {
1825
"invocationLocation": "root",
1926
"invocationStrategy": "once",
20-
"overrideCommand": ["python3", "x.py", "check", "--json-output"]
27+
"overrideCommand": [
28+
"python3",
29+
"x.py",
30+
"check",
31+
"--json-output",
32+
"--build-dir",
33+
"build/rust-analyzer"
34+
]
2135
},
2236
"linkedProjects": [
2337
"Cargo.toml",

0 commit comments

Comments
 (0)