Debt - Hook up a generic textual document highlight provider for single and multi file settings #224884
+43
−82
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:
dto
was 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: 10
is for a match on the selectorscore: 5
is for anything withlanguage: '*'
score: 0
is 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