Fixes a few bugs with #247 and converts it to use tree-sitter rather than a regex-based implementation. This should be faster on larger documents and makes it more robust to edge cases in tag regexes. This also handles newlines correctly, as the old PR caused the editor to no longer be able to delete newlines
Also fixes a small bug in the TreeSitterClient that caused every query to be dispatched to main asynchronously. This was the cause for a few visual oddities like flashing colors when changing themes. This also improves highlighting while scrolling fast as most highlights are processed synchronously.
Removes extensions on NewlineProcessingFilter
Cleans up TagFilter
Moves all newline processing to the one filter
Use tree-sitter for tag completion, supporting the following languages: HTML, JSX, TSX
Adds a few methods to TreeSitterClient for synchronously querying the tree sitter tree.
Adds a new TreeSitterClientExecutor class that the client uses to execute operations safely asynchronously and synchronously.
This is extremely useful for testing, as it allows the tests to force all operations to happen synchronously.
Adds a check to dispatchMain to see if the thread is already the main thread (meaning no async dispatch)
Description
Fixes a few bugs with #247 and converts it to use tree-sitter rather than a regex-based implementation. This should be faster on larger documents and makes it more robust to edge cases in tag regexes. This also handles newlines correctly, as the old PR caused the editor to no longer be able to delete newlines
Also fixes a small bug in the
TreeSitterClient
that caused every query to be dispatched to main asynchronously. This was the cause for a few visual oddities like flashing colors when changing themes. This also improves highlighting while scrolling fast as most highlights are processed synchronously.NewlineProcessingFilter
TagFilter
TreeSitterClient
for synchronously querying the tree sitter tree.TreeSitterClientExecutor
class that the client uses to execute operations safely asynchronously and synchronously.dispatchMain
to see if the thread is already the main thread (meaning no async dispatch)Related Issues
244
Checklist
Screenshots
https://github.com/CodeEditApp/CodeEditSourceEditor/assets/35942988/8fc559a4-15c9-4b4e-a3aa-57c86c57f7c9
https://github.com/CodeEditApp/CodeEditSourceEditor/assets/35942988/a209b40f-7aa3-4105-aa37-5608e8b4bcdb