From 0c0ffec33a23a79840e5b3254dfe441a149b6c8c Mon Sep 17 00:00:00 2001 From: Noratrieb <48135649+Noratrieb@users.noreply.github.com> Date: Sun, 1 Jun 2025 19:49:37 +0200 Subject: [PATCH] make r-a wrapper better --- home-manager/vscode.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/home-manager/vscode.nix b/home-manager/vscode.nix index b195c0d..5250f2b 100644 --- a/home-manager/vscode.nix +++ b/home-manager/vscode.nix @@ -17,8 +17,14 @@ # Language-specific "rust-analyzer.server.path" = lib.getExe (pkgs.writeShellApplication { name = "rust-analyzer-nightly-wrapper"; + # Ensure that we always use rust-analyzer from the nightly toolchain + # - in case a rust-toolchain.toml doens't have rust-analyzer + # - to ensure we get the latest fixes even if an older toolchain is used + # We can't do rust-analyzer +nightly, as that would inherit use of the nightly toolchain + # to all children of r-a, including cargo, which is very bad. text = '' - exec ${lib.getExe' pkgs.rustup "rust-analyzer"} +nightly + ra=$(${lib.getExe' pkgs.rustup "rustup"} +nightly which rust-analyzer) + exec "$ra" ''; }); "[nix]"."editor.formatOnSave" = true;