From 606490e97515a837be10673c1b1c1f57c077b4a5 Mon Sep 17 00:00:00 2001 From: Dennis Schoepf Date: Wed, 4 Mar 2026 00:59:03 +0100 Subject: [PATCH] workaround --- modules/neovim/_editing.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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;