From 8f4adb4f79c4276124a56a583834a20633204ba0 Mon Sep 17 00:00:00 2001 From: thomasjm Date: Thu, 8 Oct 2026 23:03:14 -0700 Subject: [PATCH 1/2] Rust: add a setting for rust-analyzer's inferred-type hints, on by default --- .../kernels/rust/language_server_rust_analyzer/config.nix | 2 +- modules/kernels/rust/module.nix | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/kernels/rust/language_server_rust_analyzer/config.nix b/modules/kernels/rust/language_server_rust_analyzer/config.nix index 67f5727c..5b101e70 100644 --- a/modules/kernels/rust/language_server_rust_analyzer/config.nix +++ b/modules/kernels/rust/language_server_rust_analyzer/config.nix @@ -149,7 +149,7 @@ let "reborrowHints" = "never"; "renderColons" = true; "typeHints" = { - "enable" = false; + "enable" = settings.typeHints; "hideClosureInitialization" = false; "hideNamedConstructor" = false; }; diff --git a/modules/kernels/rust/module.nix b/modules/kernels/rust/module.nix index 0a691e71..6d66f5ce 100644 --- a/modules/kernels/rust/module.nix +++ b/modules/kernels/rust/module.nix @@ -73,6 +73,12 @@ in type = types.bool; default = true; }; + lsp.rust-analyzer.typeHints = mkOption { + title = "Rust-analyzer: show inferred types inline"; + description = "Draw the inferred type next to a `let` binding or a closure parameter. rust-analyzer ships this off and expects the editor to ask for it, which is why it produces no hints by default."; + type = types.bool; + default = true; + }; lsp.rust-analyzer.debug = mkOption { title = "Rust-analyzer: debug output"; type = types.bool; From b32918a6d7c212040dbdb8b4a34fe720f2c72346 Mon Sep 17 00:00:00 2001 From: thomasjm Date: Thu, 8 Oct 2026 23:03:14 -0700 Subject: [PATCH 2/2] Regenerate the options docs --- OPTIONS.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/OPTIONS.md b/OPTIONS.md index 39fe7f13..c52abb84 100644 --- a/OPTIONS.md +++ b/OPTIONS.md @@ -2483,6 +2483,29 @@ false +## kernels\.rust\.lsp\.rust-analyzer\.typeHints + + + +**Rust-analyzer: show inferred types inline** + +Draw the inferred type next to a ` let ` binding or a closure parameter\. rust-analyzer ships this off and expects the editor to ask for it, which is why it produces no hints by default\. + + + +*Type:* +boolean + + + +*Default:* + +```nix +true +``` + + + ## kernels\.rust\.misc\.enableVariableInspector