RubixDev / syntastica

Modern and easy syntax highlighting using tree-sitter
https://rubixdev.github.io/syntastica/
GNU General Public License v3.0
16 stars 3 forks source link

Highlighting existing tree #4

Closed diocletiann closed 1 year ago

diocletiann commented 1 year ago

Thought you might be interested in this, would be a solid performance improvement on large files if the consumer keeps their tree updated like an editor might want to do. https://github.com/tree-sitter/tree-sitter/pull/2200

RubixDev commented 1 year ago

I actually had this on my private to-do list for quite some time already, but didn't get to doing it yet. With commit 0277d5203c53156a23be965cae14c48f0d4062fa I added a new method called process_tree to Processor which can be used for incremental parsing. The implementation is based on the linked PR. Just be aware that when using this method, you will have to do handle the parsing and language injections yourself.

diocletiann commented 1 year ago

This is great, thanks!