lib: remove nixvimTypes alias

This commit is contained in:
Matt Sturgeon 2024-09-27 08:07:20 +01:00
parent bafc6308f6
commit 2f49c76a6a
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
59 changed files with 261 additions and 278 deletions

View file

@ -61,7 +61,7 @@ in
{
warnings =
# TODO: expand this warning to ft & cmd sources lists and `showDefs` the offending definitions
optional (helpers.nixvimTypes.isRawType cfg.settings.sources) ''
optional (lib.types.isRawType cfg.settings.sources) ''
Nixvim (plugins.cmp): You have enabled `autoEnableSources` that tells Nixvim to automatically
enable the source plugins with respect to the list of sources provided in `settings.sources`.
However, the latter is proveded as a raw lua string which is not parseable by Nixvim.

View file

@ -38,7 +38,7 @@ with lib;
mapping = mkOption {
default = { };
type = with helpers.nixvimTypes; maybeRaw (attrsOf strLua);
type = with lib.types; maybeRaw (attrsOf strLua);
description = ''
cmp mappings declaration.
See `:h cmp-mapping` for more information.
@ -46,7 +46,7 @@ with lib;
apply =
v:
# Handle the raw case first
if helpers.nixvimTypes.isRawType v then
if lib.types.isRawType v then
v
# When v is an attrs **but not {__raw = ...}**
else
@ -64,7 +64,7 @@ with lib;
snippet = {
expand = mkOption {
type = with helpers.nixvimTypes; nullOr strLuaFn;
type = with lib.types; nullOr strLuaFn;
default = null;
description = ''
The snippet expansion function. That's how nvim-cmp interacts with a particular snippet
@ -115,8 +115,7 @@ with lib;
keyword_pattern = helpers.defaultNullOpts.mkLua ''[[\%(-\?\d\+\%(\.\d\+\)\?\|\h\w*\%(-\w*\)*\)]]'' "The default keyword pattern.";
autocomplete =
helpers.defaultNullOpts.mkNullable
(with helpers.nixvimTypes; either (enum [ false ]) (listOf strLua))
helpers.defaultNullOpts.mkNullable (with lib.types; either (enum [ false ]) (listOf strLua))
[ "require('cmp.types').cmp.TriggerEvent.TextChanged" ]
''
The event to trigger autocompletion.
@ -210,7 +209,7 @@ with lib;
'';
comparators = mkOption {
type = with helpers.nixvimTypes; nullOr (listOf strLuaFn);
type = with lib.types; nullOr (listOf strLuaFn);
apply = v: helpers.ifNonNull' v (map helpers.mkRaw v);
default = null;
description = ''

View file

@ -81,7 +81,7 @@ let
in
mkOption {
default = [ ];
type = with helpers.nixvimTypes; maybeRaw (listOf sourceType);
type = with lib.types; maybeRaw (listOf sourceType);
description = ''
The sources to use.
Can either be a list of `sourceConfigs` which will be made directly to a Lua object.

View file

@ -161,7 +161,7 @@ in
};
action = mkOption {
type = helpers.nixvimTypes.strLuaFn;
type = lib.types.strLuaFn;
apply = helpers.mkRaw;
description = ''
The parameters to the action function are the different sources (currently `git`,