workaround

This commit is contained in:
Dennis Schoepf 2026-03-04 00:59:03 +01:00
parent f87246b5ce
commit 606490e975

View file

@ -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;