plugins/luasnip: rename extraConfig to settings (more consistent with RFC-42)

This commit is contained in:
Gaetan Lepage 2024-08-04 11:44:18 +02:00 committed by GaetanLepage
parent 6f7cf23b22
commit 25da1220ad

View file

@ -50,22 +50,32 @@ let
}; };
in in
{ {
imports =
let
basePluginPath = [
"plugins"
"luasnip"
];
in
[
# TODO introduced 2024-08-04. Remove after 24.11
(lib.mkRenamedOptionModule (basePluginPath ++ [ "extraConfig" ]) (basePluginPath ++ [ "settings" ]))
];
options.plugins.luasnip = { options.plugins.luasnip = {
enable = mkEnableOption "luasnip"; enable = mkEnableOption "luasnip";
package = helpers.mkPluginPackageOption "luasnip" pkgs.vimPlugins.luasnip; package = helpers.mkPluginPackageOption "luasnip" pkgs.vimPlugins.luasnip;
extraConfig = mkOption { settings = mkOption {
type = types.attrsOf types.anything; type = with types; attrsOf anything;
description = '' description = ''
Extra config options for luasnip. Options provided to the `require('luasnip').config.setup()` function.",
Example:
{
enable_autosnippets = true,
store_selection_keys = "<Tab>",
}
''; '';
example = {
enable_autosnippets = true;
store_selection_keys = "<Tab>";
};
default = { }; default = { };
}; };
@ -156,7 +166,7 @@ in
]; ];
extraConfig = [ extraConfig = [
'' ''
require("luasnip").config.set_config(${helpers.toLuaObject cfg.extraConfig}) require("luasnip").config.setup(${helpers.toLuaObject cfg.settings})
'' ''
]; ];
in in