Remove syntactic colorization in favor of text mate colorization #3821
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.
Reasons to leverage the existing text mate colorization instead of our lexer for syntactic colorization:
Our hypothesis was that our lexer would be faster than text mate's regexp-based approach. But, in practice, due to how we need to marshal ranges from native to TS, manage TextEditorDecorations, and manage visible ranges, the built in text mate colorization is orders of magnitude faster by comparison, especially with larger source files.
Text mate distinguishes between a large number of syntactic token types, all of which may potentially be independently colored by themes. It would be difficult to match this behavior with our own syntactic colorization.
Not having to merge syntactic and semantic tokens ourselves makes our implementation a lot simpler.