Reengineer theme application to match Sublime #209
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.
Fixes #133 and additional problems discovered in #203 while not noticeably regressing end-to-end performance.
This supersedes #203 and I'll close it and point to this PR. This PR does use the main piece of code from #203 to reimplement one of the highlighter methods as well as the ideas and cases from that PR so thanks @keith-hall!
It took a number of hours and a few false starts to figure out a way to be correct like #203 while not regressing performance but I came up with a way that is asymptotically the same as current syntect master and with a small difference in constant factors that is within the noise of the current benchmarks.
It does this by caching the matching styles and scores of single-scope selectors (the majority) because pushing additional things can't make them un-match. This doesn't apply to multi-scope selectors with exclusions which are applied at the end to finalize the style.
This PR removes some previously public methods that had incorrect behaviour. I don't think anyone used them but this PR should go in before the major release anyhow to be semver compliant.
After this PR is reviewed and merged that should finally be everything necessary before the 3.0 release.