Skip to content

Commit

Permalink
CommentController.activeCommentThread not updated when navigating fro…
Browse files Browse the repository at this point in the history
…m editor gutter

Fixes #223824
  • Loading branch information
alexr00 committed Jul 26, 2024
1 parent cdb4d0d commit 06800b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,11 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
this._commentThread.collapsibleState = languages.CommentThreadCollapsibleState.Collapsed;
}

public expand() {
public expand(setActive?: boolean) {
this._commentThread.collapsibleState = languages.CommentThreadCollapsibleState.Expanded;
if (setActive) {
this.commentService.setActiveCommentAndThread(this.uniqueOwner, { thread: this._commentThread });
}
}

public getGlyphPosition(): number {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ export class CommentController implements IEditorContribution {
const existingCommentsAtLine = this._commentWidgets.filter(widget => widget.getGlyphPosition() === (commentRange ? commentRange.endLineNumber : 0));
if (existingCommentsAtLine.length) {
const allExpanded = existingCommentsAtLine.every(widget => widget.expanded);
existingCommentsAtLine.forEach(allExpanded ? widget => widget.collapse() : widget => widget.expand());
existingCommentsAtLine.forEach(allExpanded ? widget => widget.collapse() : widget => widget.expand(true));
this.processNextThreadToAdd();
return;
} else {
Expand Down

0 comments on commit 06800b8

Please sign in to comment.