Open
Description
Neovim version
0.9.4
Language affected
All
Query
rainbow-delimiters-react
Strategy
No response
Description
Hi, for some reason the healthcheck fails when I have the javascript query rule 'rainbow-delimiters-react' enabled. When I comment it out, the healthcheck passes without issue.
Healthcheck Output
==============================================================================
rainbow-delimiters: require("rainbow-delimiters.health").check()
- ERROR Failed to run healthcheck for "rainbow-delimiters" plugin. Exception:
function health#check, line 25
Vim(eval):E5108: Error executing lua ...im/0.9.4/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 1260 for language javascript
stack traceback:
[C]: in function '_ts_parse_query'
...im/0.9.4/share/nvim/runtime/lua/vim/treesitter/query.lua:259: in function 'get'
...ainbow-delimiters.nvim/lua/rainbow-delimiters/health.lua:63: in function 'check_query'
...ainbow-delimiters.nvim/lua/rainbow-delimiters/health.lua:160: in function 'check'
[string "luaeval()"]:1: in main chunk
Lazy Settings
Just a note, I like to include as many default settings as I can to make it easier to change settings without looking at documentation. So that is why there are so many comments and settings in my configuration.
{
'hiphish/rainbow-delimiters.nvim',
dependencies = "nvim-treesitter/nvim-treesitter",
event = "VeryLazy",
config = function()
local rainbow = require 'rainbow-delimiters'
vim.g.rainbow_delimiters = {
-- Each language is based on a treesitter language name.
-- Defines the highlighting strategy.
strategy = {
--[[
'global' - Highlight all delimiters, updates with document
changes.
'local' - Highlight only the subtree that contains the cursor,
updates when the cursor moves.
--]]
-- Default Strategy
[''] = rainbow.strategy['global'],
html = rainbow.strategy['local'],
latex = function()
-- Disabled for very large files,
if vim.fn.line('$') > 10000 then
return nil
-- global strategy for large files,
elseif vim.fn.line('$') > 1000 then
return rainbow.strategy['global']
end
-- local strategy otherwise
return rainbow.strategy['local']
end
},
-- Defines what to match
query = {
-- Default Query - Reasonable set of parenthesis and similar
-- delimiters in most languages
[''] = 'rainbow-delimiters',
-- Matches `\begin` and `\end` instructions
latex = 'rainbow-blocks',
-- Matches keywords like `function` and `end` as well as
-- parenthesis
lua = 'rainbow-blocks',
-- Includes React support
javascript = 'rainbow-delimiters-react',
--[[
-- Only parenthesis without React tags
javascript = 'rainbow-parens',
-- Only typescript highlighting without React tags
tsx = 'rainbow-parens',
--]]
-- Matches keywords like `begin` and `end` as well as
-- parenthesis
verilog = 'rainbow-blocks',
},
highlight = {
'RainbowDelimiterRed',
'RainbowDelimiterYellow',
'RainbowDelimiterBlue',
'RainbowDelimiterOrange',
'RainbowDelimiterGreen',
'RainbowDelimiterViolet',
'RainbowDelimiterCyan',
},
--[[
blacklist = {
'c',
'cpp',
},
whitelist = {
'python',
'javascript',
},
log = {
file = '~/.local/state/lvim/rainbow-delimiters.log',
level = vim.log.levels.DEBUG,
},
--]]
}
end
}