plugins/lsp: normalize plugin defaults

This commit is contained in:
Matt Sturgeon 2024-06-11 16:53:12 +01:00
parent 6f408f2bd0
commit 0f07201a0c
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
10 changed files with 205 additions and 199 deletions

View file

@ -15,9 +15,10 @@ in
package = helpers.mkPluginPackageOption "conform-nvim" pkgs.vimPlugins.conform-nvim;
formattersByFt =
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "see documentation"
''
formattersByFt = helpers.defaultNullOpts.mkAttrsOf' {
type = types.anything;
# Unknown plugin default
description = ''
```nix
# Map of filetype to formatters
formattersByFt =
@ -35,10 +36,10 @@ in
};
```
'';
};
formatOnSave =
helpers.defaultNullOpts.mkNullable
(
formatOnSave = helpers.defaultNullOpts.mkNullable' {
type =
with helpers.nixvimTypes;
either strLuaFn (submodule {
options = {
@ -53,19 +54,18 @@ in
description = "See :help conform.format for details.";
};
};
})
)
"see documentation"
''
});
# Unknown plugin default
description = ''
If this is set, Conform will run the formatter on save.
It will pass the table to conform.format().
This can also be a function that returns the table.
See :help conform.format for details.
'';
};
formatAfterSave =
helpers.defaultNullOpts.mkNullable
(
formatAfterSave = helpers.defaultNullOpts.mkNullable' {
type =
with helpers.nixvimTypes;
either strLuaFn (submodule {
options = {
@ -75,14 +75,14 @@ in
description = "See :help conform.format for details.";
};
};
})
)
"see documentation"
''
});
# Unknown plugin default
description = ''
If this is set, Conform will run the formatter asynchronously after save.
It will pass the table to conform.format().
This can also be a function that returns the table.
'';
};
logLevel = helpers.defaultNullOpts.mkLogLevel "error" ''
Set the log level. Use `:ConformInfo` to see the location of the log file.
@ -90,9 +90,11 @@ in
notifyOnError = helpers.defaultNullOpts.mkBool true "Conform will notify you when a formatter errors";
formatters =
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "see documentation"
"Custom formatters and changes to built-in formatters";
formatters = helpers.defaultNullOpts.mkAttrsOf' {
type = types.anything;
# Unknown plugin default
description = "Custom formatters and changes to built-in formatters";
};
};
config =

View file

@ -149,7 +149,7 @@ in
# Options related to LSP progress subsystem
progress = {
pollRate = helpers.defaultNullOpts.mkNullable (with types; either (enum [ false ]) number) "0" ''
pollRate = helpers.defaultNullOpts.mkNullable (with types; either (enum [ false ]) number) 0 ''
How and when to poll for progress messages.
Set to `0` to immediately poll on each `|LspProgress|` event.
@ -232,15 +232,13 @@ in
will be installed).
'';
ignore = helpers.defaultNullOpts.mkNullable (with types; listOf str) "[]" ''
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
List of LSP servers to ignore.
'';
# Options related to how LSP progress messages are displayed as notifications
display = {
renderLimit =
helpers.defaultNullOpts.mkNullable (with types; either (enum [ false ]) number) "16"
''
renderLimit = helpers.defaultNullOpts.mkNullable (with types; either (enum [ false ]) number) 16 ''
How many LSP messages to show at once.
If `false`, no limit.
@ -316,14 +314,12 @@ in
formatGroupName = helpers.defaultNullOpts.mkLuaFn "function(group) return tostring(group) end" "How to format a progress notification group's name.";
overrides =
helpers.defaultNullOpts.mkNullable (with types; attrsOf notificationConfigType)
''
helpers.defaultNullOpts.mkAttrsOf notificationConfigType
{
rust_analyzer = {
name = "rust-analyzer";
};
}
''
''
Override options from the default notification config.
Keys of the table are each notification group's `key`.
@ -379,12 +375,8 @@ in
'';
configs =
helpers.defaultNullOpts.mkNullable (with types; attrsOf (either notificationConfigType str))
''
{
default = "require('fidget.notification').default_config";
}
''
helpers.defaultNullOpts.mkAttrsOf (with types; either str notificationConfigType)
{ default = "require('fidget.notification').default_config"; }
''
How to configure notification groups when instantiated.
@ -551,11 +543,11 @@ in
floatPrecision = helpers.defaultNullOpts.mkNullable (
with types; numbers.between 0.0 1.0
) "0.01" "Limit the number of decimals displayed for floats.";
) 1.0e-2 "Limit the number of decimals displayed for floats.";
path =
helpers.defaultNullOpts.mkNullable (with types; either str helpers.nixvimTypes.rawLua)
''{__raw = "string.format('%s/fidget.nvim.log', vim.fn.stdpath('cache'))";}''
helpers.defaultNullOpts.mkStr
{ __raw = "string.format('%s/fidget.nvim.log', vim.fn.stdpath('cache'))"; }
''
Where Fidget writes its logs to.

View file

@ -69,13 +69,13 @@ in
};
clang = {
extraArgs = helpers.defaultNullOpts.mkNullable (with types; listOf str) "[]" ''
extraArgs = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Additional arguments for `compile_commands.json` entries.
Example: `["-frounding-math"]`
'';
excludeArgs = helpers.defaultNullOpts.mkNullable (with types; listOf str) "[]" ''
excludeArgs = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Excluded arguments for `compile_commands.json` entries.
If your compiler is not Clang and it supports arguments which Clang doesn't understand, then
@ -84,7 +84,7 @@ in
Example: `["-frounding-math"]`
'';
pathMappings = helpers.defaultNullOpts.mkNullable (with types; listOf str) "[]" ''
pathMappings = helpers.defaultNullOpts.mkListOf types.str [ ] ''
A list of `src>dest` path conversions used to remap the paths of files in the project.
This can be used to move a project to a new location without re-indexing.
@ -238,7 +238,7 @@ in
Also consider using `index.multiVersionBlacklist` to exclude system headers.
'';
multiVersionBlacklist = helpers.defaultNullOpts.mkNullable (with types; listOf str) "[]" ''
multiVersionBlacklist = helpers.defaultNullOpts.mkListOf types.str [ ] ''
A list of regular expressions matching files that should not be indexed via multi-version
if `index.multiVersion` is set to `1`.
@ -248,7 +248,7 @@ in
Example: `["^/usr/include"]`
'';
initialBlacklist = helpers.defaultNullOpts.mkNullable (with types; listOf str) "[]" ''
initialBlacklist = helpers.defaultNullOpts.mkListOf types.str [ ] ''
A list of regular expressions matching files that should not be indexed when the `ccls`
server starts up, but will still be indexed if a client opens them.
If there are areas of the project that you have no interest in indexing you can use this to

View file

@ -44,7 +44,7 @@ in
Setting this explicitly to `true` will install the dependency for this plugin (flake8).
'';
exclude = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
exclude = helpers.defaultNullOpts.mkListOf types.str [ ] ''
List of files or directories to exclude.
'';
@ -60,7 +60,7 @@ in
Hang closing bracket instead of matching indentation of opening bracket's line.
'';
ignore = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
List of errors and warnings to ignore (or skip).
'';
@ -76,7 +76,7 @@ in
Set indentation spaces.
'';
perFileIgnores = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
perFileIgnores = helpers.defaultNullOpts.mkListOf types.str [ ] ''
A pairing of filenames and violation codes that defines which violations to ignore in a
particular file.
@ -89,11 +89,11 @@ in
};
jedi = {
auto_import_modules =
helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[ \"numpy\" ]"
"List of module names for `jedi.settings.auto_import_modules`.";
auto_import_modules = helpers.defaultNullOpts.mkListOf types.str [
"numpy"
] "List of module names for `jedi.settings.auto_import_modules`.";
extra_paths = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
extra_paths = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Define extra paths for jedi.Script.
'';
@ -129,10 +129,12 @@ in
How many labels and snippets (at most) should be resolved.
'';
cache_for =
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
"[ \"pandas\" \"numpy\" \"tensorflow\" \"matplotlib\" ]"
"Modules for which labels and snippets should be cached.";
cache_for = helpers.defaultNullOpts.mkListOf types.str [
"pandas"
"numpy"
"tensorflow"
"matplotlib"
] "Modules for which labels and snippets should be cached.";
};
jedi_definition = {
@ -189,7 +191,7 @@ in
preload = {
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
modules = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
modules = helpers.defaultNullOpts.mkListOf types.str [ ] ''
List of modules to import on startup.
'';
};
@ -201,11 +203,11 @@ in
(pycodestyle).
'';
exclude = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
exclude = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Exclude files or directories which match these patterns.
'';
filename = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
filename = helpers.defaultNullOpts.mkListOf types.str [ ] ''
When parsing directories, only check filenames matching these patterns.
'';
@ -213,7 +215,7 @@ in
Select errors and warnings.
'';
ignore = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Ignore errors and warnings.
'';
@ -244,15 +246,15 @@ in
"None"
]) "Choose the basic list of checked errors by specifying an existing convention.";
addIgnore = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
addIgnore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Ignore errors and warnings in addition to the specified convention.
'';
addSelect = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
addSelect = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Select errors and warnings in addition to the specified convention.
'';
ignore = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Ignore errors and warnings.
'';
@ -284,7 +286,7 @@ in
Setting this explicitly to `true` will install the dependency for this plugin (pylint).
'';
args = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
args = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Arguments to pass to pylint.
'';
@ -352,23 +354,13 @@ in
This option often is too strict to be useful.
'';
overrides =
helpers.defaultNullOpts.mkNullable
(types.listOf (
types.oneOf [
types.bool
types.str
helpers.nixvimTypes.rawLua
]
))
"[true]"
''
overrides = helpers.defaultNullOpts.mkListOf (with types; either bool str) [ true ] ''
Specifies a list of alternate or supplemental command-line options.
This modifies the options passed to mypy or the mypy-specific ones passed to dmypy run.
When present, the special boolean member true is replaced with the command-line options that
would've been passed had overrides not been specified.
Later options take precedence, which allows for replacing or negating individual default
options (see mypy.main:process_options and mypy --help | grep inverse).
options (see `mypy.main:process_options` and `mypy --help | grep inverse`).
'';
dmypy_status_file = helpers.defaultNullOpts.mkStr ".dmypy.json" ''
@ -376,7 +368,7 @@ in
This modifies the --status-file option passed to dmypy given dmypy is active.
'';
config_sub_paths = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
config_sub_paths = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Specifies sub paths under which the mypy configuration file may be found.
For each directory searched for the mypy config file, this also searches the sub paths
specified here.
@ -449,7 +441,7 @@ in
config = helpers.mkNullOrOption types.str "Path to optional pyproject.toml file.";
exclude = helpers.defaultNullOpts.mkNullable (with types; listOf str) "[]" ''
exclude = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Exclude files from being checked by ruff.
'';
@ -457,11 +449,11 @@ in
Path to the ruff executable. Assumed to be in PATH by default.
'';
ignore = helpers.defaultNullOpts.mkNullable (with types; listOf str) "[]" ''
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Error codes to ignore.
'';
extendIgnore = helpers.defaultNullOpts.mkNullable (with types; listOf str) "[]" ''
extendIgnore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Same as ignore, but append to existing ignores.
'';
@ -471,15 +463,15 @@ in
File-specific error codes to be ignored.
'';
select = helpers.defaultNullOpts.mkNullable (with types; listOf str) "[]" ''
select = helpers.defaultNullOpts.mkListOf types.str [ ] ''
List of error codes to enable.
'';
extendSelect = helpers.defaultNullOpts.mkNullable (with types; listOf str) "[]" ''
extendSelect = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Same as select, but append to existing error codes.
'';
format = helpers.defaultNullOpts.mkNullable (with types; listOf str) "[]" ''
format = helpers.defaultNullOpts.mkListOf types.str [ ] ''
List of error codes to fix during formatting.
The default is ["I"], any additional codes are appended to this list.
'';

View file

@ -50,7 +50,7 @@ with lib;
If set to null or not set, the extension will use the default behavior of the Typst compiler.
'';
fontPaths = helpers.defaultNullOpts.mkListOf types.str "[]" ''
fontPaths = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Font paths, which doesn't allow for dynamic configuration.
Note: you can use vscode variables in the path, e.g. `$\{workspaceFolder}/fonts`.
'';
@ -69,7 +69,7 @@ with lib;
server level.
'';
typstExtraArgs = helpers.defaultNullOpts.mkListOf types.str "[]" ''
typstExtraArgs = helpers.defaultNullOpts.mkListOf types.str [ ] ''
You can pass any arguments as you like, and we will try to follow behaviors of the
**same version** of typst-cli.

View file

@ -22,7 +22,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
'';
in
{
kind_labels = helpers.defaultNullOpts.mkAttrsOf types.str "{}" ''
kind_labels = helpers.defaultNullOpts.mkAttrsOf types.str { } ''
An optional map from LSP symbol kinds to label symbols. Used to decorate the current function name.
'';

View file

@ -66,21 +66,25 @@ in
actionfix = helpers.defaultNullOpts.mkStr "" "Action fix icon.";
lines = helpers.defaultNullOpts.mkNullable (
with types; listOf str
) ''["" "" "" "" ""]'' "Symbols used in virtual text connect.";
lines = helpers.defaultNullOpts.mkListOf types.str [
""
""
""
""
""
] "Symbols used in virtual text connect.";
kind = helpers.defaultNullOpts.mkNullable types.attrs "{}" "LSP kind custom table.";
kind = helpers.defaultNullOpts.mkAttrsOf types.anything { } "LSP kind custom table.";
impSign = helpers.defaultNullOpts.mkStr "󰳛 " "Implement icon.";
};
hover = {
maxWidth = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.9" ''
maxWidth = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.9 ''
Defines float window width.
'';
maxHeight = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.8" ''
maxHeight = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.8 ''
Defines float window height.
'';
@ -107,19 +111,19 @@ in
Enable number shortcuts to execute code action quickly.
'';
maxWidth = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.8" ''
maxWidth = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.8 ''
Diagnostic jump window max width.
'';
maxHeight = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.6" ''
maxHeight = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.6 ''
Diagnostic jump window max height.
'';
maxShowWidth = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.9" ''
maxShowWidth = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.9 ''
Show window max width when layout is float.
'';
maxShowHeight = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.6" ''
maxShowHeight = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.6 ''
Show window max height when layout is float.
'';
@ -201,19 +205,19 @@ in
};
finder = {
maxHeight = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.5" ''
maxHeight = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.5 ''
`max_height` of the finder window (float layout).
'';
leftWidth = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.3" ''
leftWidth = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.3 ''
Width of the left finder window (float layout).
'';
rightWidth = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.3" ''
rightWidth = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.3 ''
Width of the right finder window (float layout).
'';
methods = helpers.defaultNullOpts.mkNullable (with types; attrsOf str) "{}" ''
methods = helpers.defaultNullOpts.mkAttrsOf types.str { } ''
Keys are alias of LSP methods.
Values are LSP methods, which you want show in finder.
@ -243,7 +247,7 @@ in
If its true, it will disable show the no response message.
'';
filter = helpers.defaultNullOpts.mkNullable (with types; attrsOf str) "{}" ''
filter = helpers.defaultNullOpts.mkAttrsOf types.str { } ''
Keys are LSP methods.
Values are a filter handler.
Function parameter are `client_id` and `result`.
@ -269,11 +273,11 @@ in
};
definition = {
width = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.6" ''
width = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.6 ''
Defines float window width.
'';
height = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.5" ''
height = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.5 ''
Defines float window height.
'';
@ -309,11 +313,11 @@ in
projectMaxWidth = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0
1.0
) "0.5" "Width for the `project_replace` float window.";
) 0.5 "Width for the `project_replace` float window.";
projectMaxHeight = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0
1.0
) "0.5" "Height for the `project_replace` float window.";
) 0.5 "Height for the `project_replace` float window.";
keys = {
quit = mkKeymapOption "<C-k>" "Quit rename window or `project_replace` window.";
@ -369,15 +373,15 @@ in
]
''
`float` or `normal`.
Default is normal.
If set to float, above options will ignored.
'';
maxHeight = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.5" ''
maxHeight = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.5 ''
Height of outline float layout.
'';
leftWidth = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.3" ''
leftWidth = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.3 ''
Width of outline float layout left window.
'';

View file

@ -127,7 +127,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
Highlight group to highlight the floating window.
'';
win_opts = helpers.defaultNullOpts.mkAttrsOf types.anything "{}" ''
win_opts = helpers.defaultNullOpts.mkAttrsOf types.anything { } ''
Window options.
See |vim.lsp.util.open_floating_preview| and |nvim_open_win|.
Note that some options may be overridden by |open_floating_preview|.
@ -176,22 +176,28 @@ helpers.neovim-plugin.mkNeovimPlugin config {
Set to a negative value to avoid setting the updatetime.
'';
pattern = helpers.defaultNullOpts.mkListOf types.str ''["*"]'' ''
pattern = helpers.defaultNullOpts.mkListOf types.str [ "*" ] ''
See |nvim_create_autocmd| and |autocmd-pattern|.
'';
events = helpers.defaultNullOpts.mkListOf types.str ''["CursorHold" "CursorHoldI"]'' ''
events =
helpers.defaultNullOpts.mkListOf types.str
[
"CursorHold"
"CursorHoldI"
]
''
See |nvim_create_autocmd|.
'';
};
ignore = {
clients = helpers.defaultNullOpts.mkListOf types.str "[]" ''
clients = helpers.defaultNullOpts.mkListOf types.str [ ] ''
LSP client names to ignore.
Example: {"null-ls", "lua_ls"}
'';
ft = helpers.defaultNullOpts.mkListOf types.str "[]" ''
ft = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Filetypes to ignore.
Example: {"neo-tree", "lua"}
'';

View file

@ -180,23 +180,26 @@ helpers.neovim-plugin.mkNeovimPlugin config {
description = "Manually refresh";
};
jump = {
default = "[ \"<cr>\" \"<tab>\" ]";
default = [
"<cr>"
"<tab>"
];
description = "Jump to the diagnostic or open / close folds";
};
open_split = {
default = "[ \"<c-x>\" ]";
default = [ "<c-x>" ];
description = "Open buffer in new split";
};
open_vsplit = {
default = "[ \"<c-v>\" ]";
default = [ "<c-v>" ];
description = "Open buffer in new vsplit";
};
open_tab = {
default = "[ \"<c-t>\" ]";
default = [ "<c-t>" ];
description = "Open buffer in new tab";
};
jump_close = {
default = "[ \"o\" ]";
default = [ "o" ];
description = "Jump to the diagnostic and close the list";
};
toggle_mode = {
@ -216,15 +219,24 @@ helpers.neovim-plugin.mkNeovimPlugin config {
description = "Preview the diagnostic location";
};
close_folds = {
default = "[ \"zM\" \"zm\" ]";
default = [
"zM"
"zm"
];
description = "Close all folds";
};
open_folds = {
default = "[ \"zR\" \"zr\" ]";
default = [
"zR"
"zr"
];
description = "Open all folds";
};
toggle_fold = {
default = "[ \"zA\" \"za\" ]";
default = [
"zA"
"za"
];
description = "Toggle fold of current file";
};
previous = {
@ -241,11 +253,9 @@ helpers.neovim-plugin.mkNeovimPlugin config {
Add an indent guide below the fold icons.
'';
win_config = helpers.defaultNullOpts.mkAttrsOf types.anything ''
{
win_config = helpers.defaultNullOpts.mkAttrsOf types.anything {
border = "single";
}
'' "Configuration for floating windows. See `|nvim_open_win()|`.";
} "Configuration for floating windows. See `|nvim_open_win()|`.";
auto_open = helpers.defaultNullOpts.mkBool false ''
Automatically open the list when you have diagnostics.
@ -264,14 +274,15 @@ helpers.neovim-plugin.mkNeovimPlugin config {
Automatically fold a file trouble list at creation.
'';
auto_jump = helpers.defaultNullOpts.mkListOf types.str ''["lsp_definitions"]'' ''
auto_jump = helpers.defaultNullOpts.mkListOf types.str [ "lsp_definitions" ] ''
For the given modes, automatically jump if there is only a single result.
'';
include_declaration =
helpers.defaultNullOpts.mkListOf types.str
''["lsp_references" "lsp_implementations" "lsp_definitions"]''
"For the given modes, include the declaration of the current symbol in the results.";
include_declaration = helpers.defaultNullOpts.mkListOf types.str [
"lsp_references"
"lsp_implementations"
"lsp_definitions"
] "For the given modes, include the declaration of the current symbol in the results.";
signs =
mapAttrs

View file

@ -41,18 +41,17 @@ in
) defaultKeymaps;
popupType =
helpers.defaultNullOpts.mkEnum
helpers.defaultNullOpts.mkEnumFirstDefault
[
"popup"
"horizontal"
"vertical"
]
"popup"
''
Default AI popup type.
'';
openaiApiKey = helpers.mkNullOrOption (with types; either str helpers.nixvimTypes.rawLua) ''
openaiApiKey = helpers.defaultNullOpts.mkStr null ''
An alternative way to set your API key.
'';
@ -66,12 +65,12 @@ in
additionalInstructions = helpers.mkNullOrOption types.str "Any additional instructions.";
searchEngine = helpers.defaultNullOpts.mkEnum [
searchEngine = helpers.defaultNullOpts.mkEnumFirstDefault [
"google"
"duck_duck_go"
"stack_overflow"
"github"
] "google" "Default search engine.";
] "Default search engine.";
hooks = {
requestStarted = helpers.defaultNullOpts.mkLuaFn "nil" "Callback for request start.";