about summary refs log tree commit diff
path: root/src/etc/rust_analyzer_helix.toml
diff options
context:
space:
mode:
authorKajetan Puchalski <kajetan.puchalski@tuta.io>2024-09-24 01:45:56 +0100
committerKajetan Puchalski <kajetan.puchalski@tuta.io>2024-09-27 17:28:19 +0100
commit6453f7e51463c7e94081bd135219c44e15bc174a (patch)
tree167f9e5c0fcfbde8af43e01090060ab2000a265c /src/etc/rust_analyzer_helix.toml
parent7042c269c166191cd5d8daf0409890903df7af57 (diff)
downloadrust-6453f7e51463c7e94081bd135219c44e15bc174a.tar.gz
rust-6453f7e51463c7e94081bd135219c44e15bc174a.zip
etc: Add rust-analyzer configs for eglot & helix
LSP configuration in editors like Emacs (eglot) and helix does not
use the same JSON format as vscode and vim do. It is not obvious
how to set up LSP for rustc in those editors and the dev guide currently
does not cover them. Adding sample configuration files for those editors
alongside the currently existing JSON one would be helpful.
Diffstat (limited to 'src/etc/rust_analyzer_helix.toml')
-rw-r--r--src/etc/rust_analyzer_helix.toml49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/etc/rust_analyzer_helix.toml b/src/etc/rust_analyzer_helix.toml
new file mode 100644
index 00000000000..642350cad34
--- /dev/null
+++ b/src/etc/rust_analyzer_helix.toml
@@ -0,0 +1,49 @@
+[language-server.rust-analyzer.config]
+linkedProjects = [
+    "Cargo.toml",
+    "src/tools/x/Cargo.toml",
+    "src/bootstrap/Cargo.toml",
+    "src/tools/rust-analyzer/Cargo.toml",
+    "compiler/rustc_codegen_cranelift/Cargo.toml",
+    "compiler/rustc_codegen_gcc/Cargo.toml"
+]
+
+[language-server.rust-analyzer.config.check]
+invocationLocation = "root"
+invocationStrategy = "once"
+overrideCommand = [
+    "python3",
+    "x.py",
+    "check",
+    "--json-output",
+]
+
+[language-server.rust-analyzer.config.rustfmt]
+overrideCommand = [
+    "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"
+enable = true
+
+[language-server.rust-analyzer.config.rustc]
+source = "./Cargo.toml"
+
+[language-server.rust-analyzer.config.cargo]
+sysrootSrc = "./library"
+
+[language-server.rust-analyzer.config.cargo.extraEnv]
+RUSTC_BOOTSTRAP = "1"
+
+[language-server.rust-analyzer.config.cargo.buildScripts]
+enable = true
+invocationLocation = "root"
+invocationStrategy = "once"
+overrideCommand = [
+    "python3",
+    "x.py",
+    "check",
+    "--json-output",
+]