mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 14:31:31 +01:00
Add provideAllComments method to comments provider
This commit is contained in:
@@ -50,8 +50,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
|
||||
|
||||
const outerEditorURI = outerEditor.getModel().uri;
|
||||
this.provideComments(outerEditorURI).then(commentThreads => {
|
||||
controller.setComments(commentThreads);
|
||||
this._commentService.setCommentsForResource(outerEditorURI, commentThreads);
|
||||
this._commentService.setComments(outerEditorURI, commentThreads);
|
||||
});
|
||||
this.provideNewCommentRange(outerEditor.getModel()).then(newActions => {
|
||||
controller.setNewCommentActions(newActions);
|
||||
@@ -61,11 +60,20 @@ export class MainThreadComments extends Disposable implements MainThreadComments
|
||||
|
||||
$registerCommentProvider(handle: number): void {
|
||||
this._providers.set(handle, undefined);
|
||||
this._panelService.setPanelEnablement(COMMENTS_PANEL_ID, true);
|
||||
// Fetch all comments
|
||||
this._proxy.$provideAllComments(handle).then(commentThreads => {
|
||||
if (commentThreads) {
|
||||
this._commentService.setAllComments(commentThreads);
|
||||
this._panelService.setPanelEnablement(COMMENTS_PANEL_ID, true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
$unregisterCommentProvider(handle: number): void {
|
||||
this._providers.delete(handle);
|
||||
this._panelService.setPanelEnablement(COMMENTS_PANEL_ID, false);
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
|
||||
Reference in New Issue
Block a user