From 1b8ac1d09d6eea72e9305ba977d6449106251349 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Thu, 7 Jul 2022 17:40:22 +0200 Subject: [PATCH] Fix 2 clicks to show collapsed comments (#154365) Fixes #153924 --- .../contrib/comments/browser/commentsEditorContribution.ts | 1 + src/vs/workbench/contrib/comments/browser/commentsView.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts b/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts index 335976fbac8..41ed64d6d55 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts @@ -382,6 +382,7 @@ export class CommentController implements IEditorContribution { this._commentingRangeDecorator.update(this.editor, []); this._commentThreadRangeDecorator.update(this.editor, []); dispose(this._commentWidgets); + this._commentWidgets = []; } })); diff --git a/src/vs/workbench/contrib/comments/browser/commentsView.ts b/src/vs/workbench/contrib/comments/browser/commentsView.ts index d6883919fa6..4c38db0a895 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsView.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsView.ts @@ -234,7 +234,7 @@ export class CommentsPanel extends ViewPane { const commentToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].comment.uniqueIdInThread : element.comment.uniqueIdInThread; if (threadToReveal && isCodeEditor(editor)) { const controller = CommentController.get(editor); - controller?.revealCommentThread(threadToReveal, commentToReveal, false); + controller?.revealCommentThread(threadToReveal, commentToReveal, true); } return true;