Closed bicyclespokesperson closed 1 year ago
Also experience this error, also confirm that commenting out those lines in textobjects.scm
fixes
I personally don't have this problem.
@dwcoates Are you also using LunarVim?
I think what's likely that happened was that C parser has been updated, and your nvim-treesitter
version is old. This used to happen when you use LunarVim because they snapshot the old version and restrict it from being updated.
@theHamsta Can you confirm this? @mortezadadgar Anything you know why this happens?
Thanks for the quick reply! It seems like this is indeed the case. The last commit to update the C parser was a178586
, and I can confirm that e1e670a
(the commit before a178586
) works for me. Unfortunately I can't update nvim-treesitter
without breaking some other lunarvim stuff, but I'm happy to use e1e670a
for now
That's good to know! Until LunarVim officially update nvim-treesitter
it will be good to snapshot this plugin as well.
Describe the bug
When I open a C++ file, I get a crash with the following error message:
I cannot reference text objects in C/C++, though I can reference them in other languages such as Python.
It appears to be related to the C grammar file (which is imported by the C++ grammar file): If I comment out this section of the file, the crash goes away and I can reference the C++ text objects correctly (with, for example,
vaf
to select a function).To Reproduce
Opening any C or C++ file in vim can cause the crash for me.
I'm using the following config (copy/pasted from the README). I'm using lunarvim 1.3, (a wrapper layer around neovim 0.9), so this config is in
~/.config/lvim/config.lua
Expected behavior
There should be no crash, the file should open and I should be able to reference C++ text objects.
Output of
:checkhealth nvim-treesitter
============================================================================== nvim-treesitter: require("nvim-treesitter.health").check() Installation ~ - OK `tree-sitter` found 0.20.8 (9f398ca955d3329110d31ed523dac5275074948f) (parser generator, only needed for :TSInstallFromGrammar) - OK `node` found v14.18.2 (only needed for :TSInstallFromGrammar) - OK `git` executable found. - OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" } Version: Apple clang version 15.0.0 (clang-1500.0.40.1) - OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI. OS Info: { machine = "arm64", release = "22.6.0", sysname = "Darwin", version = "Darwin Kernel Version 22.6.0: Wed Jul 5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000" } ~ Parser/Features H L F I J - bash ✓ ✓ ✓ . ✓ - c ✓ ✓ ✓ ✓ ✓ - cmake ✓ . ✓ . . - comment ✓ . . . . - cpp ✓ ✓ ✓ ✓ ✓ - dockerfile ✓ . . . ✓ - gitcommit ✓ . . . ✓ - gitignore ✓ . . . . - go ✓ ✓ ✓ ✓ ✓ - javascript ✓ ✓ ✓ ✓ ✓ - json ✓ ✓ ✓ ✓ . - kdl ✓ ✓ ✓ ✓ ✓ - lua ✓ ✓ ✓ ✓ ✓ - make ✓ . ✓ . ✓ - markdown ✓ . ✓ . ✓ - markdown_inline ✓ . . . ✓ - proto ✓ . ✓ . . - python ✓ ✓ ✓ ✓ ✓ - query ✓ ✓ ✓ ✓ ✓ - regex ✓ . . . . - rust ✓ ✓ ✓ ✓ ✓ - toml ✓ ✓ ✓ ✓ ✓ - vim ✓ ✓ ✓ . ✓ - vimdoc ✓ . . . ✓ - yaml ✓ ✓ ✓ ✓ ✓ Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections +) multiple parsers found, only one will be used x) errors found in the query, try to run :TSUpdate {lang} ~
Output of
nvim --version
Additional context Add any other context about the problem here.