tree-sitter / tree-sitter-rust

Rust grammar for tree-sitter
MIT License
357 stars 101 forks source link

bug: slow textobject select queries #225

Closed aclementev closed 6 months ago

aclementev commented 6 months ago

Did you check existing issues?

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

No response

Describe the bug

Opening a rust buffer with the textobject.select.enable = true option set is very slow. The time difference when opening an empty foo.rs file is very noticeable (on my setup it's around ~700ms).

Steps To Reproduce/Bad Parse Tree

  1. Enable textobject.select treesitter plugin
  2. Open any rust file, even an empty one: nvim foo.rs

Expected Behavior/Parse Tree

I would expect the buffer to not take a noticeable amount of time to open (<300ms or something like that)

Repro

No response

ObserverOfTime commented 6 months ago

https://github.com/nvim-treesitter/nvim-treesitter-textobjects

aclementev commented 6 months ago

I am familiar with the textobjects project, but I figured it would be related to this parser, since I use it with other multiple languages and this is the only one that shows this behavior

amaanq commented 6 months ago

that's not a parser issue - that's a query issue