craftzdog / dotfiles-public

My personal dotfiles
6.32k stars 1.16k forks source link

treesitter not working properly and the autocomplete for typescript and other languages #149

Closed stormespace closed 9 months ago

stormespace commented 9 months ago

when i open the init.lua file it always gets an error like this Error detected while processing FileType Autocommands for "*": Error executing lua callback: ...im/0.9.4/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 2992 for language lua stack traceback: [C]: in function '_ts_parse_query' ...im/0.9.4/share/nvim/runtime/lua/vim/treesitter/query.lua:259: in function 'get' ...4/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:114: in function 'new' ...r/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:61: in function '_create_parser' ...r/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:131: in function 'get_parser' ...r/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:459: 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/nv im-treesitter/configs.lua:132> [C]: in function 'nvim_exec_autocmds' ...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:157: in function <...hare/nvim/lazy/lazy.nvim/lua/la zy/core/handler/event.lua:156> [C]: in function 'xpcall' .../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try' ...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:156: in function 'trigger' ...ocal/share/nvim/lazy/LazyVim/lua/lazyvim/util/plugin.lua:103: in function '' vim/_editor.lua: in function <vim/_editor.lua:0> and after that this error another error

`Failed to run `config` for nvim-treesitter

...im/0.9.4/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 2992 for language
lua

 stacktrace:
  - /home/linuxbrew/.linuxbrew/Cellar/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter/query.lua:259 _in_ **get**
  - /home/linuxbrew/.linuxbrew/Cellar/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:114 _in_ **new
**
  - /home/linuxbrew/.linuxbrew/Cellar/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:61 _in_ **_create_parser**
  - /home/linuxbrew/.linuxbrew/Cellar/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:131 _in_ **get_parser**
  - /home/linuxbrew/.linuxbrew/Cellar/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:459 _in_ **start**
  - lua/plugins/treesitter.lua:56 _in_ **config**
  - /LazyVim/lua/lazyvim/util/plugin.lua:93 _in_ ****
  - vim/_editor.lua:0`

and when i when i am writing lua it always has an error Capture

language servers(for example typescript) dont give good completions for the code Capture2

namnh198 commented 9 months ago

It's like there's a lack of installation of the lua package for nvtreesitter. You can try command TSInstall lua to install this. Or try add to some lines to install all packages

ensure_installed = "all",
ignore_install = { "phpdoc", "comment" },
kul-sudo commented 9 months ago

Do git init in the folder of your TS project for the LSP to work.

stormespace commented 9 months ago

thanks now it works