Skip to content

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

Merged
Michael Lively (Yoyokrazy) merged 3 commits into
mainfrom
urban-stork
Aug 6, 2024
Merged

Michael Lively (Yoyokrazy) merged 3 commits into
mainfrom
urban-stork

Conversation

@Yoyokrazy

@Yoyokrazy Michael Lively (Yoyokrazy) commented Aug 5, 2024 •

Copy link
Copy Markdown
Collaborator

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
Michael Lively (Yoyokrazy) enabled auto-merge (squash) August 6, 2024 17:12
@Yoyokrazy
Michael Lively (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