Skip to content

Commit

Permalink
neovimUtils.grammarToPlugin: improve error message on invalid grammar…
Browse files Browse the repository at this point in the history
…Plugins (#357062)
  • Loading branch information
khaneliman authored Nov 19, 2024
2 parents d6a0449 + 600f850 commit 36be531
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkgs/applications/editors/neovim/utils.nix
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ let
(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;

toNvimTreesitterGrammar = callPackage ({ }:
Expand Down

0 comments on commit 36be531

Please sign in to comment.