nvim-treesitter / nvim-treesitter

Nvim Treesitter configurations and abstraction layer
Apache License 2.0
10.89k stars 907 forks source link

Treesitter not working properly #7283

Closed SDDDDDDDDDGG closed 1 month ago

SDDDDDDDDDGG commented 1 month ago

Describe the bug

when testing highlighting on cpp file, got error: treesitter/highlighter: Error executing lua: /use/share/nvim/runtime/lua/vim/treesitter/query.lua:557 No handler for has-ancestor? stack traceback: [C]: in function 'error' /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:557: in function 'match_preds'

To Reproduce

install with: return { "nvim-treesitter/nvim-treesitter", run = ":TSUpdate", config = function() require'nvim-treesitter.configs'.setup { ensure_installed = "all", highlight = { enable = true, }, indent = { enable = true, }, } end, }

Expected behavior

No response

Output of :checkhealth nvim-treesitter

============================================================================== nvim-treesitter: require("nvim-treesitter.health").check()

Installation ~

OS Info: { machine = "x86_64", release = "5.10.102.1-microsoft-standard-WSL2", sysname = "Linux", version = "#1 SMP Wed Mar 2 00:30:59 UTC 2022" } ~

Parser/Features H L F I J

Output of nvim --version

root@LAPTOP-OQB457IO:~/.config/nvim/lua/plugins# nvim --version NVIM v0.9.5 Build type: Release LuaJIT 2.1.1703358377

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

Additional context

No response

clason commented 1 month ago

Nvim 0.9 is no longer supported; please update to the latest version (0.10.2).