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,65 +38,70 @@ 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 = ""; expanded = "";
expanded = ""; failed = "";
failed = ""; final_child_indent = " ";
final_child_indent = " "; final_child_prefix = "";
final_child_prefix = ""; non_collapsible = "";
non_collapsible = ""; passed = "";
passed = ""; running = "";
running = ""; running_animated = [
running_animated = ["/" "|" "\\" "-" "/" "|" "\\" "-"]; "/"
skipped = ""; "|"
unknown = ""; "\\"
watching = ""; "-"
} "/"
'' "Icons used throughout the UI. Defaults use VSCode's codicons."; "|"
"\\"
"-"
];
skipped = "";
unknown = "";
watching = "";
} "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"; expand_marker = "NeotestExpandMarker";
expand_marker = "NeotestExpandMarker"; failed = "NeotestFailed";
failed = "NeotestFailed"; file = "NeotestFile";
file = "NeotestFile"; focused = "NeotestFocused";
focused = "NeotestFocused"; indent = "NeotestIndent";
indent = "NeotestIndent"; marked = "NeotestMarked";
marked = "NeotestMarked"; namespace = "NeotestNamespace";
namespace = "NeotestNamespace"; passed = "NeotestPassed";
passed = "NeotestPassed"; running = "NeotestRunning";
running = "NeotestRunning"; select_win = "NeotestWinSelect";
select_win = "NeotestWinSelect"; skipped = "NeotestSkipped";
skipped = "NeotestSkipped"; target = "NeotestTarget";
target = "NeotestTarget"; 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,28 +127,29 @@ 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 = [
expand = ["<CR>" "<2-LeftMouse>"]; "<CR>"
expand_all = "e"; "<2-LeftMouse>"
jumpto = "i"; ];
mark = "m"; expand_all = "e";
next_failed = "J"; jumpto = "i";
output = "o"; mark = "m";
prev_failed = "K"; next_failed = "J";
run = "r"; output = "o";
run_marked = "R"; prev_failed = "K";
short = "O"; run = "r";
stop = "u"; run_marked = "R";
target = "t"; short = "O";
watch = "w"; stop = "u";
} target = "t";
'' "Buffer mappings for summary window."; watch = "w";
} "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.
''; '';