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 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;