From 72ae0de74df0775d6ac94d65bc7204d49b8e69b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Thu, 14 Nov 2024 08:09:46 +0100 Subject: [PATCH] add rust-analyzer config --- programs/desktop/development/rust/default.nix | 1 + programs/editors/vscode/default.nix | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/programs/desktop/development/rust/default.nix b/programs/desktop/development/rust/default.nix index af921b4c..c029a548 100644 --- a/programs/desktop/development/rust/default.nix +++ b/programs/desktop/development/rust/default.nix @@ -8,6 +8,7 @@ home.packages = with pkgs; [ (rust-bin.selectLatestNightlyWith (toolchain: toolchain.default)) cargo-mommy + clang ]; home.shellAliases = { cargo = "${pkgs.cargo-mommy}/bin/cargo-mommy"; diff --git a/programs/editors/vscode/default.nix b/programs/editors/vscode/default.nix index 4f67088e..44d8fd0c 100644 --- a/programs/editors/vscode/default.nix +++ b/programs/editors/vscode/default.nix @@ -36,6 +36,23 @@ "nix.serverSettings" = { nil.formatting.command = [ "${pkgs.nixfmt-rfc-style}/bin/nixfmt" ]; }; + "rust-analyzer.diagnostics.experimental.enable" = true; + "rust-analyzer.diagnostics.styleLints.enable" = true; + "rust-analyzer.hover.actions.references.enable" = true; + "rust-analyzer.imports.granularity.enforce" = true; + "rust-analyzer.inlayHints.bindingModeHints.enable" = true; + "rust-analyzer.inlayHints.closureCaptureHints.enable" = true; + "rust-analyzer.inlayHints.closureReturnTypeHints.enable" = "always"; + "rust-analyzer.inlayHints.discriminantHints.enable" = "always"; + "rust-analyzer.inlayHints.lifetimeElisionHints.enable" = "always"; + "rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames" = true; + "rust-analyzer.inlayHints.rangeExclusiveHints.enable" = true; + "rust-analyzer.inlayHints.typeHints.hideClosureInitialization" = false; + "rust-analyzer.interpret.tests" = true; + "rust-analyzer.lens.references.adt.enable" = true; + "rust-analyzer.lens.references.enumVariant.enable" = true; + "rust-analyzer.lens.references.method.enable" = true; + "rust-analyzer.lens.references.trait.enable" = true; "sops.binPath" = "${pkgs.sops}/bin/sops"; "workbench.iconTheme" = "material-icon-theme"; };