Fixes an issue where tree sitter edits would call their completion handler while the lock on the executor was still held, causing the next (should be sync) operation to be forced async. This led to all highlights being executed asynchronously.
The fix is to do the operation on the tree-sitter state using the executor, and then call the completion once that value is held. The highlighter can then query for syntax highlights and the executor is freed to execute them synchronously.
This does not effect async operations, just an improvement for synchronous operations.
Related changes:
Removed a redundant piece of code and replaced it with an existing helper function.
Makes the invalidation of highlighted code explicit. Sometimes highlights can be missed by the layout manager so making the layout of the highlighted ranges explicit removes that possibility.
Description
Related changes:
Related Issues
None.
Checklist
Screenshots
Before
https://github.com/user-attachments/assets/7262208e-4c8b-4f91-9442-67311bd7baf3
After
https://github.com/user-attachments/assets/bd33124d-000e-42ea-af37-307404cbda05