mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 06:21:50 +01:00
Support multiple workspaceCommentsProvider contributions in comments panel, fixes #51622
This commit is contained in:
@@ -53,7 +53,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
|
||||
|
||||
const outerEditorURI = outerEditor.getModel().uri;
|
||||
this.provideDocumentComments(outerEditorURI).then(commentInfos => {
|
||||
this._commentService.setComments(outerEditorURI, commentInfos.filter(info => info !== null));
|
||||
this._commentService.setDocumentComments(outerEditorURI, commentInfos.filter(info => info !== null));
|
||||
});
|
||||
}));
|
||||
}
|
||||
@@ -84,7 +84,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
|
||||
this._panelService.openPanel(COMMENTS_PANEL_ID);
|
||||
this._proxy.$provideWorkspaceComments(handle).then(commentThreads => {
|
||||
if (commentThreads) {
|
||||
this._commentService.setAllComments(commentThreads);
|
||||
this._commentService.setWorkspaceComments(handle, commentThreads);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -96,8 +96,10 @@ export class MainThreadComments extends Disposable implements MainThreadComments
|
||||
|
||||
$unregisterWorkspaceCommentProvider(handle: number): void {
|
||||
this._workspaceProviders.delete(handle);
|
||||
this._panelService.setPanelEnablement(COMMENTS_PANEL_ID, false);
|
||||
this._commentService.removeAllComments();
|
||||
if (this._workspaceProviders.size === 0) {
|
||||
this._panelService.setPanelEnablement(COMMENTS_PANEL_ID, false);
|
||||
}
|
||||
this._commentService.removeWorkspaceComments(handle);
|
||||
}
|
||||
|
||||
$onDidCommentThreadsChange(handle: number, event: modes.CommentThreadChangedEvent) {
|
||||
|
||||
Reference in New Issue
Block a user