plugins/lspsaga: iconsPackage -> icons provider options

This commit is contained in:
Austin Horstman 2024-09-20 13:34:04 -05:00
parent 254b15d066
commit 5ff98645ce
No known key found for this signature in database
2 changed files with 49 additions and 19 deletions

View file

@ -3,6 +3,7 @@
helpers, helpers,
config, config,
pkgs, pkgs,
options,
... ...
}: }:
with lib; with lib;
@ -43,7 +44,20 @@ in
"keys" "keys"
"borderStyle" "borderStyle"
"renamePromptPrefix" "renamePromptPrefix"
]; ]
++ [
# TODO: added 2024-09-20 remove after 24.11
(lib.mkRemovedOptionModule
[
"plugins"
"lspsaga"
"iconsPackage"
]
''
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
''
)
];
options = { options = {
plugins.lspsaga = helpers.neovim-plugin.extraOptionsOptions // { plugins.lspsaga = helpers.neovim-plugin.extraOptionsOptions // {
@ -56,11 +70,6 @@ in
]; ];
}; };
iconsPackage = lib.mkPackageOption pkgs [
"vimPlugins"
"nvim-web-devicons"
] { nullable = true; };
ui = { ui = {
border = helpers.defaultNullOpts.mkBorder "single" "lspsaga" ""; border = helpers.defaultNullOpts.mkBorder "single" "lspsaga" "";
@ -461,18 +470,37 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
extraPlugins = # TODO: added 2024-09-20 remove after 24.11
[ cfg.package ] plugins.web-devicons =
++ optional ( lib.mkIf
cfg.iconsPackage != null && (cfg.ui.devicon == null || cfg.ui.devicon) (
) cfg.iconsPackage; (cfg.ui.devicon == null || cfg.ui.devicon)
&& !(
warnings = mkIf ( config.plugins.mini.enable
# https://nvimdev.github.io/lspsaga/implement/#default-options && config.plugins.mini.modules ? icons
(isBool cfg.implement.enable && cfg.implement.enable) && config.plugins.mini.mockDevIcons
&& (isBool cfg.symbolInWinbar.enable && !cfg.symbolInWinbar.enable) )
) [ "You have enabled the `implement` module but it requires `symbolInWinbar` to be enabled." ]; )
{
enable = mkOverride 1490 true;
};
warnings =
lib.optional
(
(cfg.ui.devicon == null || cfg.ui.devicon)
&& options.plugins.web-devicons.enable.highestPrio == 1490
)
''
Nixvim (plugins.lspsaga) `web-devicons` automatic installation is deprecated.
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
''
++ lib.optional (
# https://nvimdev.github.io/lspsaga/implement/#default-options
(isBool cfg.implement.enable && cfg.implement.enable)
&& (isBool cfg.symbolInWinbar.enable && !cfg.symbolInWinbar.enable)
) "You have enabled the `implement` module but it requires `symbolInWinbar` to be enabled.";
extraPlugins = [ cfg.package ];
extraConfigLua = extraConfigLua =
let let
setupOptions = setupOptions =

View file

@ -1,9 +1,11 @@
{ {
empty = { empty = {
plugins.web-devicons.enable = true;
plugins.lspsaga.enable = true; plugins.lspsaga.enable = true;
}; };
defaults = { defaults = {
plugins.web-devicons.enable = true;
plugins.lspsaga = { plugins.lspsaga = {
enable = true; enable = true;
@ -171,10 +173,10 @@
}; };
}; };
no-packages = { no-icons = {
plugins.web-devicons.enable = false;
plugins.lspsaga = { plugins.lspsaga = {
enable = true; enable = true;
iconsPackage = null;
}; };
}; };
} }