mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-14 08:36:57 +00:00
feat(rust): various cleans
This commit is contained in:
parent
ac4547b2e9
commit
c031ff9087
2 changed files with 9 additions and 7 deletions
|
|
@ -1,19 +1,22 @@
|
||||||
{lib}: let
|
{lib}: let
|
||||||
|
inherit (lib.generators) toPretty;
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
|
inherit (lib.strings) removeSuffix optionalString;
|
||||||
|
inherit (lib.types) bool;
|
||||||
|
|
||||||
mkLspPresetEnableOption = option: display: fileTypes:
|
mkLspPresetEnableOption = option: display: fileTypes:
|
||||||
mkLspPresetEnableOptionWithDesc option display fileTypes "";
|
mkLspPresetEnableOptionWithDesc option display fileTypes "";
|
||||||
|
|
||||||
mkLspPresetEnableOptionWithDesc = option: display: fileTypes: description:
|
mkLspPresetEnableOptionWithDesc = option: display: fileTypes: description:
|
||||||
mkOption {
|
mkOption {
|
||||||
type = lib.types.bool;
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = lib.removeSuffix "\n" (''
|
description = removeSuffix "\n" (''
|
||||||
The ${display} Language Server.
|
The ${display} Language Server.
|
||||||
Default `filetypes = ${lib.generators.toPretty {} fileTypes}`.
|
Default `filetypes = ${toPretty {} fileTypes}`.
|
||||||
Use {option}`vim.lsp.servers.${option}` for customization.
|
Use {option}`vim.lsp.servers.${option}` for customization.
|
||||||
''
|
''
|
||||||
+ lib.optionalString (description != "") ''
|
+ optionalString (description != "") ''
|
||||||
|
|
||||||
${description}
|
${description}
|
||||||
'');
|
'');
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,11 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib) genAttrs;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalMD literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalMD literalExpression;
|
||||||
inherit (lib.attrsets) attrNames;
|
inherit (lib.attrsets) attrNames;
|
||||||
inherit (lib.types) bool package listOf enum int;
|
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.dag) entryAfter;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption deprecatedSingleOrListOf;
|
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;
|
assertion = !(builtins.elem "rust-analyzer" cfg.lsp.server) && !config.vim.lsp.rust-analyzer.enable;
|
||||||
message = ''
|
message = ''
|
||||||
Rustaceanvim fully manages its own rust-analyzer.
|
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.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue