-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Add multi-document highlight provider feature #198467
Conversation
…cript semantic multi-doc
Todo:
|
src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments and suggestions tho this is already looking very good. Nice work!
src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts
Outdated
Show resolved
Hide resolved
src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts
Outdated
Show resolved
Hide resolved
src/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.ts
Outdated
Show resolved
Hide resolved
0a0066e
to
b9e92d5
Compare
All nits + feedback has been addressed. Update on the todo with the textual pieces:
// in order of score ask the occurrences provider
// until someone response with a good result
// (good = none empty array)
return first<ResourceMap<DocumentHighlight[]> | null | undefined>(orderedByScore.map(provider => () => {
const filteredModels = otherModels.filter(otherModel => {
return score(provider.selector, otherModel.uri, otherModel.getLanguageId(), true, undefined, undefined) > 0;
});
return Promise.resolve(provider.provideMultiDocumentHighlights(model, position, filteredModels, token))
.then(undefined, onUnexpectedExternalError);
}), (t: ResourceMap<DocumentHighlight[]> | null | undefined): t is ResourceMap<DocumentHighlight[]> => t instanceof ResourceMap && t.size > 0);
(t: ResourceMap<DocumentHighlight[]> | null | undefined): t is ResourceMap<DocumentHighlight[]> => t instanceof ResourceMap && t !== null && t !== undefined);
Currently the Would love some feedback on this issue @jrieken, thanks! This PR is at a state that it can be merged without risk of breaking core features, it just doesn't add the generic Textual editor feature that we initially set out to implement alongside this multi-doc feature. That will get shifted to a debt item that gets addressed in the coming December work cycle. |
Fixes #184259
re #196240
Fixes #198469
re #196354
This pull request adds support for multi-document highlight providers, allowing for the highlighting of occurrences of a variable.
It includes:
MultiDocumentHighlight