tree-sitter-grammars / tree-sitter-yaml

YAML grammar for tree-sitter
MIT License
16 stars 7 forks source link

bug: nvim-treesitter-yaml errors on large file with seemingly correct syntax #9

Open boydkelly opened 3 months ago

boydkelly commented 3 months ago

Did you check existing issues?

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

No response

Describe the bug

I have been working on this admittedly large 44,000 line file with treesitter-yaml for a few years now with no issues. However with the update to neovim .10 and changes to treesitter I am getting errors with my file. This file is processed by yq and has no reported errors with lsp, yamlfmt or yamllint.

Neovim .10 with up to date parsers Screenshot from 2024-05-28 07-38-31

Noevim .10 with nvim-treesitter pinned at 0.9.2 Screenshot from 2024-05-28 07-36-25

File lexicon.yml located here: https://gitlab.com/ci-dict/dyu-xdxf

And used here: https://dyu-lex.coastsystems.net/dyu

Steps To Reproduce/Bad Parse Tree

  1. Open file lexicon.yaml with neovim 10 and up-to-date nvim-treesitter and yaml parser installed.
  2. InspectTree will report an errror and highlighting will be wrong
  3. Pin nvim-treesitter to 0.9.2 (or maybe 0.9.5)
  4. Reinstall yaml query
  5. Open file lexicon.yaml (No errro will be reported and highlighting will be correct)

Expected Behavior/Parse Tree

InspectTree should not report errors as the file seems to be syntactically correct.

Repro

https://gitlab.com/ci-dict/dyu-xdxf/-/blob/main/lexicon.yml?ref_type=heads

https://gitlab.com/ci-dict/dyu-xdxf.git

boydkelly commented 3 months ago

Yes it really seems this is just the file size. If I truncated the file at line 32768 then treesitter will no longer report errors.