From 214731d35564896397ca4fb7590fb544331a3294 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sun, 22 Dec 2024 10:29:38 +0000 Subject: [PATCH] lib/plugins: deprecate `neovim-plugin` & `vim-plugin` aliases --- lib/default.nix | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index cb4785226..a13293b73 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -24,21 +24,6 @@ lib.makeExtensible ( plugins = call ./plugins { }; utils = call ./utils.nix { inherit _nixvimTests; }; - # plugin aliases - neovim-plugin = { - inherit (self.plugins.neovim) - extraOptionsOptions - mkNeovimPlugin - ; - }; - vim-plugin = { - inherit (self.plugins.vim) - mkSettingsOption - mkSettingsOptionDescription - mkVimPlugin - ; - }; - # Top-level helper aliases: # TODO: deprecate some aliases @@ -120,4 +105,26 @@ lib.makeExtensible ( maintainers = "lib.maintainers"; nixvimTypes = "lib.types"; } + // + # TODO: neovim-plugin & vim-plugin aliases deprecated 2024-12-22; internal functions + lib.mapAttrs' + (scope: names: { + name = "${scope}-plugin"; + value = lib.genAttrs names ( + name: + lib.warn "`${scope}-plugin.${name}` has been moved to `plugins.${scope}.${name}`." + self.plugins.${scope}.${name} + ); + }) + { + neovim = [ + "extraOptionsOptions" + "mkNeovimPlugin" + ]; + vim = [ + "mkSettingsOption" + "mkSettingsOptionDescription" + "mkVimPlugin" + ]; + } )