Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ no_llvm_build
/llvm/
/mingw-build/
/build
/build-rust-analyzer/
/build-rust-analyzer
/dist/
/unicode-downloads
/target
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/src/core/build_steps/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ Select which editor you would like to set up [default: None]: ";
"198c195ed0c070d15907b279b8b4ea96198ca71b939f5376454f3d636ab54da5",
"1c43ead340b20792b91d02b08494ee68708e7e09f56b6766629b4b72079208f1",
"eec09a09452682060afd23dd5d3536ccac5615b3cdbf427366446901215fb9f6",
"d3fbf8eca90f7e12a3609988ba2e7e5ba0c03c15d9d64344cde5147eb80fee69",
],
EditorKind::Vim | EditorKind::VsCode => &[
"ea67e259dedf60d4429b6c349a564ffcd1563cf41c920a856d1f5b16b4701ac8",
Expand Down
15 changes: 8 additions & 7 deletions src/etc/rust_analyzer_helix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# 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:
# To download rustfmt and proc macro server for r-a run the following command
# (proc macro server is downloaded automatically with pretty much any command,
# this specific one also downloads rustfmt):
# ```
# x b proc-macro-srv-cli rustfmt --stage 0 --build-dir build-rust-analyzer
# x fmt --check
# ```
# (if that doesn't work -- do `x clean` first)

[language-server.rust-analyzer.config]
linkedProjects = [
Expand All @@ -18,7 +21,6 @@ linkedProjects = [
]

[language-server.rust-analyzer.config.check]
invocationLocation = "root"
invocationStrategy = "once"
overrideCommand = [
"python3",
Expand All @@ -31,12 +33,12 @@ overrideCommand = [

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

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

[language-server.rust-analyzer.config.rustc]
Expand All @@ -50,14 +52,13 @@ RUSTC_BOOTSTRAP = "1"

[language-server.rust-analyzer.config.cargo.buildScripts]
enable = true
invocationLocation = "root"
invocationStrategy = "once"
overrideCommand = [
"python3",
"x.py",
"check",
"--json-output",
"--compile-time-deps",
"--build-dir",
"build-rust-analyzer",
"--compile-time-deps",
]
1 change: 1 addition & 0 deletions src/tools/nix-dev-shell/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pkgs.mkShell {
pkgs.nix
pkgs.glibc.out
pkgs.glibc.static
pkgs.rust-analyzer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this goes towards an aspect of editor configuration that is the users responsibility and not the projects, though I guess having the package around doesn't hurt even when it's unused.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, idk about this too. The reason I added this is that I want for the shell to work with 0 outside setup, including having any tools (like r-a or even cargo).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Noratrieb should I remove this from this PR?

x
# Get the runtime deps of the x wrapper
] ++ lists.flatten (attrsets.attrValues env);
Expand Down
Loading