RRethy / vim-illuminate

illuminate.vim - (Neo)Vim plugin for automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching.
2.12k stars 44 forks source link

vim-illuminate: An internal error has occured when open bash script #177

Closed Phantasimay closed 9 months ago

Phantasimay commented 10 months ago

Description: when i want to edit bash script i always got vim-illuminate: An internal error has occured. i have :

    "Iluminate word
    au VimEnter * hi link illuminatedWord CursorLine
    au VimEnter * hi illuminatedWord cterm=bold gui=bold
    au VimEnter * hi illuminatedCurWord cterm=underline gui=underline

in my vim config.

Note Omitting a minimal init.vim/init.lua/.vimrc will likely result in the issue being closed without explanation.

config-neovim.tar.gz

Output from :messages

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:21: Error executing lua: /usr/share/nvim/runtime/filetype.lua:22: BufReadPost Autocommands for "*"..Fi
leType Autocommands for "*": Vim(append):Error executing lua callback: /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:273: query: invalid node type at position 195
 for language bash
stack traceback:
        [C]: in function '_ts_parse_query'
        /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:273: in function 'parse'
        /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:232: in function 'get'
        /usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:128: in function 'new'
        /usr/share/nvim/runtime/lua/vim/treesitter.lua:64: in function '_create_parser'
        /usr/share/nvim/runtime/lua/vim/treesitter.lua:130: in function 'get_parser'
        /usr/share/nvim/runtime/lua/vim/treesitter.lua:457: in function 'start'
        ...m/lazy/nvim-treesitter/lua/nvim-treesitter/highlight.lua:20: in function 'attach'
        ...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:509: in function 'attach_module'
        ...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:532: in function 'reattach_module'
        ...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:133: in function <...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:132>
        [C]: in function 'nvim_cmd'
        /usr/share/nvim/runtime/filetype.lua:22: in function </usr/share/nvim/runtime/filetype.lua:21>
        [C]: in function 'nvim_buf_call'
        /usr/share/nvim/runtime/filetype.lua:21: in function </usr/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_cmd'
        /usr/share/nvim/runtime/filetype.lua:22: in function </usr/share/nvim/runtime/filetype.lua:21>
        [C]: in function 'nvim_buf_call'
        /usr/share/nvim/runtime/filetype.lua:21: in function </usr/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_buf_call'
        /usr/share/nvim/runtime/filetype.lua:21: in function </usr/share/nvim/runtime/filetype.lua:10>
vim-illuminate: An internal error has occured: false"/usr/share/nvim/runtime/lua/vim/treesitter/query.lua:273: query: invalid node type at position 195 for language bash
"

Output from :IlluminateDebug

buf_should_illuminate 1 true
config {
  delay = 100,
  filetype_overrides = {},
  filetypes_allowlist = {},
  filetypes_denylist = { "dirbuf", "dirvish", "fugitive" },
  large_file_cutoff = 1000,
  large_file_overrides = {
    delay = 100,
    providers = { "regex" }
  },
  min_count_to_highlight = 1,
  modes_allowlist = {},
  modes_denylist = { "i" },
  providers = { "treesitter", "regex" },
  providers_regex_syntax_allowlist = {},
  providers_regex_syntax_denylist = {},
  under_cursor = true
}
started false
provider table: 0x7f234f6c20e0 treesitter
`termguicolors` true

Screenshots

screenshot-10-09-23-21:31:59

Additional context i think its like these issue https://github.com/RRethy/vim-illuminate/issues/145

Phantasimay commented 10 months ago

never mind, i slove it. its because treesitter neovim must update for specific language. sorry

i slove it by :TSInstall bash. then reopen.