neovimUtils.grammarToPlugin: improve error message on invalid grammarPlugins (#357062)
This commit is contained in:
commit
36be531246
@ -176,7 +176,11 @@ let
|
|||||||
(lib.replaceStrings [ "-" ] [ "_" ])
|
(lib.replaceStrings [ "-" ] [ "_" ])
|
||||||
];
|
];
|
||||||
|
|
||||||
nvimGrammars = lib.mapAttrsToList (name: value: value.origGrammar) vimPlugins.nvim-treesitter.grammarPlugins;
|
nvimGrammars = lib.mapAttrsToList (
|
||||||
|
name: value:
|
||||||
|
value.origGrammar
|
||||||
|
or (builtins.throw "additions to `pkgs.vimPlugins.nvim-treesitter.grammarPlugins` set should be passed through `pkgs.neovimUtils.grammarToPlugin` first")
|
||||||
|
) vimPlugins.nvim-treesitter.grammarPlugins;
|
||||||
isNvimGrammar = x: builtins.elem x nvimGrammars;
|
isNvimGrammar = x: builtins.elem x nvimGrammars;
|
||||||
|
|
||||||
toNvimTreesitterGrammar = callPackage ({ }:
|
toNvimTreesitterGrammar = callPackage ({ }:
|
||||||
|
Loading…
Reference in New Issue
Block a user