plugins: remove redundant mkRaw apply functions

`strLua` now does this coercion internally.
This commit is contained in:
Matt Sturgeon 2024-09-29 15:13:49 +01:00
parent bd6aa476b8
commit 2cda50d530
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
15 changed files with 0 additions and 26 deletions

View file

@ -125,7 +125,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
See `:help conform.format` for details.
'';
apply = v: if lib.isString v then mkRaw v else v;
};
default_format_opts = defaultNullOpts.mkNullable defaultFormatSubmodule { } ''
@ -143,7 +142,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
See `:help conform.format` for details.
'';
apply = v: if lib.isString v then mkRaw v else v;
};
log_level = defaultNullOpts.mkLogLevel "error" ''

View file

@ -151,7 +151,6 @@ helpers.neovim-plugin.mkNeovimPlugin {
});
default = null;
example = "require('noice.util.spinners').spinners.circleFull";
apply = v: if isString v then helpers.mkRaw v else v;
description = "Spinner for pinned views that are loading.";
pluginDefault = {
frames = defaultFrames;
@ -182,7 +181,6 @@ helpers.neovim-plugin.mkNeovimPlugin {
# Hence, we convert the string to raw lua in `apply`.
keys = helpers.defaultNullOpts.mkAttrsOf' {
type = with lib.types; either strLuaFn (enum [ false ]);
apply = x: if x == null then null else mapAttrs (_: v: if isString v then helpers.mkRaw v else v) x;
description = ''
Buffer-local keymaps to be added to edgebar buffers.
Existing buffer-local keymaps will never be overridden.

View file

@ -156,7 +156,6 @@ with lib;
end
'';
};
apply = mapAttrs (_: helpers.mkRaw);
};
};
};

View file

@ -91,7 +91,6 @@ let
example = ''
require('lint.parser').from_pattern(pattern, groups, severity_map, defaults, opts)
'';
apply = helpers.mkRaw;
mandatory = true;
};
};

View file

@ -17,7 +17,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
adapters = mkOption {
type = with types; listOf strLua;
default = [ ];
apply = map mkRaw;
# NOTE: We hide this option from the documentation as users should use the top-level
# `adapters` option.
# They can still directly append raw lua code to this `settings.adapters` option.

View file

@ -55,7 +55,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
For "static" delimiter pairs it can be a list of strings representing the value
of the delimiter pair.
'';
apply = v: if lib.isString v then lib.nixvim.mkRaw v else v;
example = [
"( "
" )"

View file

@ -226,7 +226,6 @@ with lib;
action = mkOption {
type = lib.types.strLua;
description = "The lua code for this keymap action.";
apply = helpers.mkRaw;
};
opts = helpers.keymaps.mapConfigOptions // {
buffer = helpers.defaultNullOpts.mkBool false ''

View file

@ -30,7 +30,6 @@ with lib;
};
})
);
apply = v: map (listElem: if isString listElem then helpers.mkRaw listElem else listElem) v;
default = [ ];
description = ''
Startify displays lists. Each list consists of a `type` and optionally a `header` and

View file

@ -129,7 +129,6 @@ helpers.neovim-plugin.mkNeovimPlugin {
description = ''
Builtin click handlers.
'';
apply = mapAttrs (_: helpers.mkRaw);
example = {
Lnum = "require('statuscol.builtin').lnum_click";
FoldClose = "require('statuscol.builtin').foldclose_click";

View file

@ -95,7 +95,6 @@ rec {
${defaults}
```
'';
apply = lib.mapAttrs (_: lib.nixvim.mkRaw);
};
mkMappingsOption =

View file

@ -18,7 +18,6 @@ helpers.neovim-plugin.mkNeovimPlugin {
patterns = mkOption {
type = with lib.types; listOf strLua;
apply = map helpers.mkRaw;
default = [ ];
example = [ "[[%s/\(\n\n\)\n\+/\1/]]" ];
description = ''

View file

@ -22,7 +22,6 @@ in
onAttach = helpers.defaultNullOpts.mkLuaFn "__lspOnAttach" "Lua code to run when tsserver attaches to a buffer.";
handlers = mkOption {
type = with lib.types; nullOr (attrsOf strLuaFn);
apply = v: helpers.ifNonNull' v (mapAttrs (_: helpers.mkRaw) v);
default = null;
description = "How tsserver should respond to LSP requests";
example = {

View file

@ -43,14 +43,6 @@ with lib;
cmp mappings declaration.
See `:h cmp-mapping` for more information.
'';
apply =
v:
# Handle the raw case first
if lib.types.isRawType v then
v
# When v is an attrs **but not {__raw = ...}**
else
mapAttrs (_: helpers.mkRaw) v;
example = {
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
@ -98,7 +90,6 @@ with lib;
end
```
'';
apply = helpers.mkRaw;
example = ''
function(args)
require('luasnip').lsp_expand(args.body)
@ -210,7 +201,6 @@ with lib;
comparators = mkOption {
type = with lib.types; nullOr (listOf strLuaFn);
apply = v: helpers.ifNonNull' v (map helpers.mkRaw v);
default = null;
description = ''
The function to customize the sorting behavior.

View file

@ -162,7 +162,6 @@ in
action = mkOption {
type = lib.types.strLuaFn;
apply = helpers.mkRaw;
description = ''
The parameters to the action function are the different sources (currently `git`,
`gitlab` and `github`), the completion callback, the trigger character, the

View file

@ -207,7 +207,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
default: `{}`
'';
apply = v: if lib.isAttrs v then lib.mapAttrs (_: lib.nixvim.mkRaw) v else v;
};
request = {