Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix error causing tree-sitter highlighting to get out-of-sync when editing rapidly #18375
Identify the Bug
When using Tree-sitter, it was previously possible to get the buffer and the syntax tree into an inconsistent state by making many rapid changes to the buffer.
Description of the Change
Whenever you make a change to a buffer that's using Tree-sitter, we start incrementally re-parsing the buffer. If that parse does not complete quickly, we allow it to finish parsing in the background. Then, if you make additional edits while that parse is still going, we need to store those edits so that we can apply them after-the-fact to the new syntax tree.
We store the edits in a
Now, with this change, I'm not seeing this problem.
I was still able to reproduce the issue with syntax highlighting breaking and Atom freezing that I saw after building Atom on this commit.
I saw syntax highlighting break when pasting a 42 lines long erb file holding
I send the files I used on Slack.
Ok, thanks for testing that. I think that there's a separate issue relating to ERB specifically. I'll do a little more testing to make sure that it is actually ERB-specific.