plugins/treesitter: fix ensure_installed to allow "all"

The plugin allows passing either the string `"all"` or a list of languages.
This commit is contained in:
Matt Sturgeon 2024-07-13 10:56:24 +01:00
parent 89d74cdce1
commit 195978e627
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -134,12 +134,22 @@ helpers.neovim-plugin.mkNeovimPlugin config {
'';
};
ensure_installed = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Either "all" or a list of languages to ensure installing.
'';
ensure_installed = helpers.defaultNullOpts.mkNullable' {
type =
with helpers.nixvimTypes;
oneOf [
(enum [ "all" ])
(listOf (maybeRaw str))
rawLua
];
pluginDefault = [ ];
description = ''
Either `"all"` or a list of languages to ensure installing.
'';
};
ignore_install = helpers.defaultNullOpts.mkListOf types.str [ ] ''
List of parsers to ignore installing. Used when `ensure_installed` is set to "all".
List of parsers to ignore installing. Used when `ensure_installed` is set to `"all"`.
'';
parser_install_dir = helpers.mkNullOrOption' {
@ -163,7 +173,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
settingsExample = {
auto_install = false;
ensure_installed = [ "all" ];
ensure_installed = "all";
ignore_install = [ "rust" ];
parser_install_dir.__raw = "vim.fs.joinpath(vim.fn.stdpath('data'), 'treesitter')";
sync_install = false;