Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debt - Hook up a generic textual document highlight provider for single and multi file settings #224884

Merged
merged 3 commits into from
Aug 6, 2024

Conversation

Yoyokrazy
Copy link
Contributor

@Yoyokrazy Yoyokrazy commented Aug 5, 2024

Fixes: #196240

couple bugs were blocking this:

  • in mainthread, would return undefined if 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)
  • textual document highlight provider was only set up for multi file...
  • first() conditions weren't taking into account the result shape being a ResourceMap correctly, size = 0 is valid

A newly exposed issue:
scoring for language providers falls into one of three buckets:

  • score: 10 is for a match on the selector
  • score: 5 is for anything with language: '*'
  • score: 0 is an explicit mismatch

now 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

@Yoyokrazy Yoyokrazy requested a review from rebornix August 5, 2024 19:38
@Yoyokrazy Yoyokrazy self-assigned this Aug 5, 2024
rebornix
rebornix previously approved these changes Aug 5, 2024
@Yoyokrazy Yoyokrazy enabled auto-merge (squash) August 6, 2024 17:12
@Yoyokrazy Yoyokrazy merged commit 93f019c into main Aug 6, 2024
6 checks passed
@Yoyokrazy Yoyokrazy deleted the urban-stork branch August 6, 2024 17:34
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Register editor feature for generic multi-doc wordHighlighter
3 participants