plugins/neotest: normalize plugin defaults

This commit is contained in:
Matt Sturgeon 2024-06-11 16:53:36 +01:00
parent 0f07201a0c
commit f596505897
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -38,13 +38,12 @@ with lib;
Minimum log levels. Minimum log levels.
''; '';
consumers = helpers.defaultNullOpts.mkAttrsOf helpers.nixvimTypes.rawLua "{}" '' consumers = helpers.defaultNullOpts.mkAttrsOf helpers.nixvimTypes.strLuaFn { } ''
key: string key: string
value: lua function value: lua function
''; '';
icons = helpers.defaultNullOpts.mkAttrsOf (with types; either str (listOf str)) '' icons = helpers.defaultNullOpts.mkAttrsOf (with types; either str (listOf str)) {
{
child_indent = ""; child_indent = "";
child_prefix = ""; child_prefix = "";
collapsed = ""; collapsed = "";
@ -55,15 +54,22 @@ with lib;
non_collapsible = ""; non_collapsible = "";
passed = ""; passed = "";
running = ""; running = "";
running_animated = ["/" "|" "\\" "-" "/" "|" "\\" "-"]; running_animated = [
"/"
"|"
"\\"
"-"
"/"
"|"
"\\"
"-"
];
skipped = ""; skipped = "";
unknown = ""; unknown = "";
watching = ""; watching = "";
} } "Icons used throughout the UI. Defaults use VSCode's codicons.";
'' "Icons used throughout the UI. Defaults use VSCode's codicons.";
highlights = helpers.defaultNullOpts.mkAttrsOf types.str '' highlights = helpers.defaultNullOpts.mkAttrsOf types.str {
{
adapter_name = "NeotestAdapterName"; adapter_name = "NeotestAdapterName";
border = "NeotestBorder"; border = "NeotestBorder";
dir = "NeotestDir"; dir = "NeotestDir";
@ -82,21 +88,20 @@ with lib;
test = "NeotestTest"; test = "NeotestTest";
unknown = "NeotestUnknown"; unknown = "NeotestUnknown";
watching = "NeotestWatching"; watching = "NeotestWatching";
} } "";
'' "";
floating = { floating = {
border = helpers.defaultNullOpts.mkStr "rounded" "Border style."; border = helpers.defaultNullOpts.mkStr "rounded" "Border style.";
max_height = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.6" '' max_height = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.6 ''
Max height of window as proportion of NeoVim window. Max height of window as proportion of NeoVim window.
''; '';
max_width = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.6" '' max_width = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.6 ''
Max width of window as proportion of NeoVim window. Max width of window as proportion of NeoVim window.
''; '';
options = helpers.defaultNullOpts.mkAttrsOf types.anything "{}" '' options = helpers.defaultNullOpts.mkAttrsOf types.anything { } ''
Window local options to set on floating windows (e.g. winblend). Window local options to set on floating windows (e.g. winblend).
''; '';
}; };
@ -122,14 +127,16 @@ with lib;
expandErrors = helpers.defaultNullOpts.mkBool true "Expand all failed positions."; expandErrors = helpers.defaultNullOpts.mkBool true "Expand all failed positions.";
mappings = helpers.defaultNullOpts.mkAttrsOf (with types; either str (listOf str)) '' mappings = helpers.defaultNullOpts.mkAttrsOf (with types; either str (listOf str)) {
{
attach = "a"; attach = "a";
clear_marked = "M"; clear_marked = "M";
clear_target = "T"; clear_target = "T";
debug = "d"; debug = "d";
debug_marked = "D"; debug_marked = "D";
expand = ["<CR>" "<2-LeftMouse>"]; expand = [
"<CR>"
"<2-LeftMouse>"
];
expand_all = "e"; expand_all = "e";
jumpto = "i"; jumpto = "i";
mark = "m"; mark = "m";
@ -142,8 +149,7 @@ with lib;
stop = "u"; stop = "u";
target = "t"; target = "t";
watch = "w"; watch = "w";
} } "Buffer mappings for summary window.";
'' "Buffer mappings for summary window.";
open = helpers.defaultNullOpts.mkStr "botright vsplit | vertical resize 50" '' open = helpers.defaultNullOpts.mkStr "botright vsplit | vertical resize 50" ''
A command or function to open a window for the summary. A command or function to open a window for the summary.
@ -171,7 +177,7 @@ with lib;
quickfix = { quickfix = {
enabled = helpers.defaultNullOpts.mkBool true "Enable quickfix."; enabled = helpers.defaultNullOpts.mkBool true "Enable quickfix.";
open = helpers.defaultNullOpts.mkNullable (with types; either bool str) "`false`" '' open = helpers.defaultNullOpts.mkNullable (with types; either bool str) false ''
Set to true to open quickfix on startup, or a function to be called when the quickfix Set to true to open quickfix on startup, or a function to be called when the quickfix
results are set. results are set.
''; '';