abzcoding / lvim

πŸ§‘β€πŸš€ Bloated LunarVim πŸš€
MIT License
471 stars 65 forks source link

Error in working with javascript and typescript file #144

Closed ksajan closed 5 months ago

ksajan commented 5 months ago

Whenever I open a file or use goToReference it throws error

[Neo-tree ERROR] Error opening file: vim/_editor.lua:0: nvim_exec2()..BufReadPost Autocommands for "*": Vim(append):Error executing lua callback: ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24: Error executing lua: ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:25: nvim_exec2()..BufReadPost Autocommands for "*"..FileType Autocommands for "javascript"..FileType Autocommands for "*": Vim(append):Error executing lua callback: ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 67 for language javascript
stack traceback:
    [C]: in function '_ts_parse_query'
    ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: in function 'get_query'
    ...r-textobjects/lua/nvim-treesitter/textobjects/shared.lua:99: in function 'available_textobjects'
    ...r-textobjects/lua/nvim-treesitter/textobjects/select.lua:173: in function 'attach'
    ...lazy/opt/nvim-treesitter/lua/nvim-treesitter/configs.lua:509: in function 'attach_module'
    ...lazy/opt/nvim-treesitter/lua/nvim-treesitter/configs.lua:532: in function 'reattach_module'
    ...lazy/opt/nvim-treesitter/lua/nvim-treesitter/configs.lua:133: in function <...lazy/opt/nvim-treesitter/lua/nvim-treesitter/configs.lua:132>
    [C]: in function 'nvim_exec_autocmds'
    .../pack/lazy/opt/lazy.nvim/lua/lazy/core/handler/event.lua:157: in function <.../pack/lazy/opt/lazy.nvim/lua/lazy/core/handler/event.lua:156>
    [C]: in function 'xpcall'
    ...rvim/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try'
    ...
    ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:10>
    [C]: in function 'nvim_exec2'
    vim/_editor.lua: in function <vim/_editor.lua:0>
    [C]: in function 'pcall'
    .../site/pack/lazy/opt/neo-tree.nvim/lua/neo-tree/utils.lua:616: in function 'open_file'
    ...t/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:569: in function 'open'
    ...t/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:600: in function 'open_with_cmd'
    ...t/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:609: in function 'open'
    ...o-tree.nvim/lua/neo-tree/sources/filesystem/commands.lua:184: in function 'func'
    ...pack/lazy/opt/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:830: in function <...pack/lazy/opt/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:828>
stack traceback:
    [C]: in function 'nvim_cmd'
    ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:25: in function <...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24>
    [C]: in function 'nvim_buf_call'
    ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:10>
    [C]: in function 'nvim_exec2'
    vim/_editor.lua: in function <vim/_editor.lua:0>
    [C]: in function 'pcall'
    .../site/pack/lazy/opt/neo-tree.nvim/lua/neo-tree/utils.lua:616: in function 'open_file'
    ...t/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:569: in function 'open'
    ...t/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:600: in function 'open_with_cmd'
    ...t/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:609: in function 'open'
    ...o-tree.nvim/lua/neo-tree/sources/filesystem/commands.lua:184: in function 'func'
    ...pack/lazy/opt/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:830: in function <...pack/lazy/opt/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:828>
stack traceback:
    [C]: in function 'nvim_buf_call'
    ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:10>
    [C]: in function 'nvim_exec2'
    vim/_editor.lua: in function <vim/_editor.lua:0>
    [C]: in function 'pcall'
    .../site/pack/lazy/opt/neo-tree.nvim/lua/neo-tree/utils.lua:616: in function 'open_file'
    ...t/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:569: in function 'open'
    ...t/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:600: in function 'open_with_cmd'
    ...t/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:609: in function 'open'
    ...o-tree.nvim/lua/neo-tree/sources/filesystem/commands.lua:184: in function 'func'
    ...pack/lazy/opt/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:830: in function <...pack/lazy/opt/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:828>
Error executing vim.schedule lua callback: BufReadPost Autocommands for "*": Vim(append):Error executing lua callback: ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24: Error executing lua: ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:25: BufReadPost Autocommands for "*"..FileType Autocommands for "*": Vim(append):Error executing lua callback: ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 67 for language typescript
stack traceback:
    [C]: in function '_ts_parse_query'
    ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: in function 'get_query'
    ...r-textobjects/lua/nvim-treesitter/textobjects/shared.lua:99: in function 'available_textobjects'
    ...r-textobjects/lua/nvim-treesitter/textobjects/select.lua:173: in function 'attach'
    ...lazy/opt/nvim-treesitter/lua/nvim-treesitter/configs.lua:509: in function 'attach_module'
    ...lazy/opt/nvim-treesitter/lua/nvim-treesitter/configs.lua:532: in function 'reattach_module'
    ...lazy/opt/nvim-treesitter/lua/nvim-treesitter/configs.lua:133: in function <...lazy/opt/nvim-treesitter/lua/nvim-treesitter/configs.lua:132>
    [C]: in function 'nvim_cmd'
    ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:25: in function <...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24>
    [C]: in function 'nvim_buf_call'
    ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:10>
    [C]: in function 'bufload'
    ...vim/site/pack/lazy/opt/trouble.nvim/lua/trouble/util.lua:21: in function 'jump_to_item'
    ...vim/site/pack/lazy/opt/trouble.nvim/lua/trouble/init.lua:76: in function 'cb'
    ...ack/lazy/opt/trouble.nvim/lua/trouble/providers/init.lua:65: in function 'cb'
    ...pack/lazy/opt/trouble.nvim/lua/trouble/providers/lsp.lua:68: in function 'handler'
    ...pack/lazy/opt/trouble.nvim/lua/trouble/providers/lsp.lua:9: in function 'handler'
    ...w/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp.lua:1393: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>
stack traceback:
    [C]: in function 'nvim_cmd'
    ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:25: in function <...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24>
    [C]: in function 'nvim_buf_call'
    ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:10>
    [C]: in function 'bufload'
    ...vim/site/pack/lazy/opt/trouble.nvim/lua/trouble/util.lua:21: in function 'jump_to_item'
    ...vim/site/pack/lazy/opt/trouble.nvim/lua/trouble/init.lua:76: in function 'cb'
    ...ack/lazy/opt/trouble.nvim/lua/trouble/providers/init.lua:65: in function 'cb'
    ...pack/lazy/opt/trouble.nvim/lua/trouble/providers/lsp.lua:68: in function 'handler'
    ...pack/lazy/opt/trouble.nvim/lua/trouble/providers/lsp.lua:9: in function 'handler'
    ...w/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp.lua:1393: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>
stack traceback:
    [C]: in function 'nvim_buf_call'
    ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:10>
    [C]: in function 'bufload'
    ...vim/site/pack/lazy/opt/trouble.nvim/lua/trouble/util.lua:21: in function 'jump_to_item'
    ...vim/site/pack/lazy/opt/trouble.nvim/lua/trouble/init.lua:76: in function 'cb'
    ...ack/lazy/opt/trouble.nvim/lua/trouble/providers/init.lua:65: in function 'cb'
    ...pack/lazy/opt/trouble.nvim/lua/trouble/providers/lsp.lua:68: in function 'handler'
    ...pack/lazy/opt/trouble.nvim/lua/trouble/providers/lsp.lua:9: in function 'handler'
    ...w/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp.lua:1393: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>
stack traceback:
    [C]: in function 'bufload'
    ...vim/site/pack/lazy/opt/trouble.nvim/lua/trouble/util.lua:21: in function 'jump_to_item'
    ...vim/site/pack/lazy/opt/trouble.nvim/lua/trouble/init.lua:76: in function 'cb'
    ...ack/lazy/opt/trouble.nvim/lua/trouble/providers/init.lua:65: in function 'cb'
    ...pack/lazy/opt/trouble.nvim/lua/trouble/providers/lsp.lua:68: in function 'handler'
    ...pack/lazy/opt/trouble.nvim/lua/trouble/providers/lsp.lua:9: in function 'handler'
    ...w/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp.lua:1393: in function ''
    vim/_editor.lua: in function <vim/_editor.lua

I am unable to debug this error. I tried disabling vim-matchup ( I found something related on the internet and GitHub issue something similar so tried ) and also tested with changing the file tree ( just guessing ). Can you help me debug this issue. Thank you!

ksajan commented 5 months ago

Sorry forgot to add one more observation. When I open a javascript file first time in repo tsserver is working but the next file that is opened either using goToReference or using filetree. There is no LSP active. Couldn't find anything on this.

ksajan commented 5 months ago

I found something here issue in treesitter package - https://github.com/nvim-treesitter/nvim-treesitter/issues/3794#issuecomment-1311252687

So according to this nvim-treesitter-textobjects package the issue is coming when opening the ts or js file. Not sure why and how. When disabled this package I am no longer seeing the error. But I am seeing a new warning nvim-navic: Failed to attach to typescript-tools for current buffer. Already attached to tsserver

Can you help me with understanding what does it mean and how can I avoid this warning as its poping on every file that get opened. Thanks for the help.

abzcoding commented 5 months ago

i'm on the last version of all packages, and master version of neovim, i don't have any issues with nvim-treesitter-textobjects

also i don't use navic so can't help you there

lvim.builtin.winbar_provider = "filename" -- can be "filename" or "treesitter" or "navic" or ""

furthermore please don't use this repository as is, and pick and choose what you like from it and incorporate it in your own config

abzcoding commented 5 months ago

https://github.com/abzcoding/lvim/issues/145#issuecomment-2079551451