From c031ff9087c372ca759ee3ff9620fa8ea00b6f2e Mon Sep 17 00:00:00 2001 From: Samuel Cobb Date: Wed, 10 Jun 2026 22:45:19 +0100 Subject: [PATCH] feat(rust): various cleans --- lib/types/lsp.nix | 11 +++++++---- modules/plugins/languages/rust.nix | 5 ++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/types/lsp.nix b/lib/types/lsp.nix index 7e9ce1ba..edf34667 100644 --- a/lib/types/lsp.nix +++ b/lib/types/lsp.nix @@ -1,19 +1,22 @@ {lib}: let + inherit (lib.generators) toPretty; inherit (lib.options) mkOption; + inherit (lib.strings) removeSuffix optionalString; + inherit (lib.types) bool; mkLspPresetEnableOption = option: display: fileTypes: mkLspPresetEnableOptionWithDesc option display fileTypes ""; mkLspPresetEnableOptionWithDesc = option: display: fileTypes: description: mkOption { - type = lib.types.bool; + type = bool; default = false; - description = lib.removeSuffix "\n" ('' + description = removeSuffix "\n" ('' The ${display} Language Server. - Default `filetypes = ${lib.generators.toPretty {} fileTypes}`. + Default `filetypes = ${toPretty {} fileTypes}`. Use {option}`vim.lsp.servers.${option}` for customization. '' - + lib.optionalString (description != "") '' + + optionalString (description != "") '' ${description} ''); diff --git a/modules/plugins/languages/rust.nix b/modules/plugins/languages/rust.nix index aa0b711f..94712d5d 100644 --- a/modules/plugins/languages/rust.nix +++ b/modules/plugins/languages/rust.nix @@ -5,12 +5,11 @@ ... }: let inherit (lib.meta) getExe; - inherit (lib) genAttrs; inherit (lib.modules) mkIf mkMerge; inherit (lib.options) mkOption mkEnableOption literalMD literalExpression; inherit (lib.attrsets) attrNames; inherit (lib.types) bool package listOf enum int; - inherit (lib.nvim.attrsets) mapListToAttrs; + inherit (lib.nvim.attrsets) mapListToAttrs genAttrs; inherit (lib.nvim.dag) entryAfter; inherit (lib.nvim.lua) toLuaObject; inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption deprecatedSingleOrListOf; @@ -295,7 +294,7 @@ in { assertion = !(builtins.elem "rust-analyzer" cfg.lsp.server) && !config.vim.lsp.rust-analyzer.enable; message = '' Rustaceanvim fully manages its own rust-analyzer. - Therefore you can't use vim.langauges.rust.extensions.rustaceanvim.enable with rust-analyzer enabled. + Therefore you can't use vim.languages.rust.extensions.rustaceanvim.enable with rust-analyzer enabled. ''; } ];