Skip to content

Instantly share code, notes, and snippets.

@TaKO8Ki
Last active August 7, 2023 11:10
Show Gist options
  • Save TaKO8Ki/3eeabe987af47410d41258b9e1a21a61 to your computer and use it in GitHub Desktop.
Save TaKO8Ki/3eeabe987af47410d41258b9e1a21a61 to your computer and use it in GitHub Desktop.
rust-analyzer configuration on Helix editor for rustc development
[[language]]
name = "rust"
scope = "source.rust"
injection-regex = "rust"
file-types = ["rs"]
roots = ["Cargo.toml", "Cargo.lock"]
auto-format = true
comment-token = "//"
language-server = { command = "rust-analyzer" }
[language.config]
check.invocationLocation = "root"
check.invocationStrategy = "once"
check.overrideCommand = [
"python3",
"x.py",
"check",
"--json-output"
]
cargo.buildScripts.overrideCommand = [
"python3",
"x.py",
"check",
"--json-output"
]
rustfmt.overrideCommand = [
"./build/host/rustfmt/bin/rustfmt",
"--edition=2021"
]
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"
]
cargo.sysrootSrc = "./library"
rustc.source = "./Cargo.toml"
procMacro.server = "./build/host/stage0/libexec/rust-analyzer-proc-macro-srv"
procMacro.enable = true
cargo.buildScripts.enable = true
cargo.buildScripts.invocationLocation = "root"
cargo.buildScripts.invocationStrategy = "once"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment