Repository navigation
Add multi-document highlight provider feature - #198467
Conversation
…cript semantic multi-doc
|
Todo:
|
Johannes Rieken (jrieken)
left a comment
There was a problem hiding this comment.
Left some comments and suggestions tho this is already looking very good. Nice work!
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 Johannes Rieken (@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. |
oof and feedback/nits addressed
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