diff --git a/src/vs/workbench/contrib/comments/browser/commentsController.ts b/src/vs/workbench/contrib/comments/browser/commentsController.ts index 53fa7b55c3576..7e6fe3265cd26 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsController.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsController.ts @@ -540,6 +540,14 @@ export class CommentController implements IEditorContribution { } } + public expandUnresolved(): void { + for (const widget of this._commentWidgets) { + if (widget.commentThread.state === languages.CommentThreadState.Unresolved) { + widget.expand(); + } + } + } + public nextCommentThread(): void { this._findNearestCommentThread(); } diff --git a/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts b/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts index bd64293679431..116782e436446 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts @@ -149,6 +149,23 @@ MenuRegistry.appendMenuItem(MenuId.CommandPalette, { when: WorkspaceHasCommenting }); +const EXPAND_UNRESOLVED_COMMENT_COMMAND = 'workbench.action.expandUnresolvedComments'; +CommandsRegistry.registerCommand({ + id: EXPAND_UNRESOLVED_COMMENT_COMMAND, + handler: (accessor) => { + return getActiveController(accessor)?.expandUnresolved(); + } +}); + +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { + command: { + id: EXPAND_UNRESOLVED_COMMENT_COMMAND, + title: nls.localize('comments.expandUnresolved', "Expand Unresolved Comments"), + category: 'Comments' + }, + when: WorkspaceHasCommenting +}); + KeybindingsRegistry.registerCommandAndKeybindingRule({ id: 'workbench.action.submitComment', weight: KeybindingWeight.EditorContrib,