workaround
This commit is contained in:
parent
f87246b5ce
commit
606490e975
1 changed files with 16 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue