Smarter Default Highlight Provider Management #310
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Updates the highlight provider parameter to correctly reflect its documentation, and use a smarter method for keeping around the default highlighter. This fixes an issue where the default highlight provider was re-initialized on every view update (keyboard navigation, keystrokes, etc.).
Now, highlight providers have two states:
nil
orArray
. If CESE sees anil
argument, it creates and keeps around aTreeSitterClient
like the documentation says. This client is kept as a variable on the view's coordinator so it isn't re-initialized between view updates.This also allows highlighting to be disabled by passing an empty array for the highlight providers parameter, causing CESE to not make any default providers.
Related Issues
Checklist
Screenshots
N/A