Repository navigation
Debt - Hook up a generic textual document highlight provider for single and multi file settings - #224884
Merged
Conversation
Peng Lyu (rebornix)
previously approved these changes
Aug 5, 2024
Justin Chen (justschen)
approved these changes
Aug 6, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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: #196240
couple bugs were blocking this:
dtowas falsy or empty, but empty would come whenever a provider didn't get any highlights (ie clicking a commment in a typescript file)first()conditions weren't taking into account the result shape being a ResourceMap correctly, size = 0 is validA newly exposed issue:
scoring for language providers falls into one of three buckets:
score: 10is for a match on the selectorscore: 5is for anything withlanguage: '*'score: 0is an explicit mismatchnow you have to consider, what if someone created a different textual highlight provider for whatever reason (perf, dif behavior, etc), and wanted to be scored above our default textual provider, but below a perfect match.
Could our textual fallback be scored at maybe a new score of 1? leaving room for some new heuristic to score at 5? time to think