diff --git a/modules/neovim/_editing.nix b/modules/neovim/_editing.nix index aec04d3..9b343fe 100644 --- a/modules/neovim/_editing.nix +++ b/modules/neovim/_editing.nix @@ -9,6 +9,22 @@ enable = true; }; + # Workaround: Neovim 0.11.x does not implement the is? / is-not? treesitter + # predicates, but newer grammar query files (tree-sitter-nix, tree-sitter-javascript) + # use (#is-not? local) to scope highlights to non-local identifiers. + # Register no-op handlers to suppress the error; remove once Neovim + # ships with built-in support for these predicates. + extraConfigLua = /* lua */ '' + -- (#is?) always returns false (node never "is" something) + vim.treesitter.query.add_predicate("is?", function() + return false + end, { force = true }) + -- (#is-not?) always returns true (node is always "not" something) + vim.treesitter.query.add_predicate("is-not?", function() + return true + end, { force = true }) + ''; + plugins.treesitter = { enable = true; highlight.enable = true;