From 600f8504be7fdba57ec605ef64c7d9a2b33e5ea5 Mon Sep 17 00:00:00 2001 From: birdee Date: Mon, 18 Nov 2024 11:29:28 -0800 Subject: [PATCH] neovimUtils.grammarToPlugin: improve error message on invalid grammarPlugins Update pkgs/applications/editors/neovim/utils.nix Co-authored-by: Perchun Pak Update pkgs/applications/editors/neovim/utils.nix Co-authored-by: Austin Horstman Update pkgs/applications/editors/neovim/utils.nix OH Co-authored-by: Austin Horstman --- pkgs/applications/editors/neovim/utils.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/neovim/utils.nix b/pkgs/applications/editors/neovim/utils.nix index 158bc31e8bb3..74a313c4196d 100644 --- a/pkgs/applications/editors/neovim/utils.nix +++ b/pkgs/applications/editors/neovim/utils.nix @@ -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 ({ }: