Skip to content

Commit

Permalink
Fix an issue in coments continue-on (microsoft#194151)
Browse files Browse the repository at this point in the history
Part of unblocking microsoft#193104
  • Loading branch information
alexr00 authored and lins0621 committed Oct 7, 2023
1 parent 501a1ae commit cb9a329
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/vs/workbench/contrib/comments/browser/commentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,10 @@ export class CommentService extends Disposable implements ICommentService {
removeContinueOnComment(pendingComment: { range: IRange; uri: URI; owner: string }): PendingCommentThread | undefined {
const pendingComments = this._continueOnComments.get(pendingComment.owner);
if (pendingComments) {
return pendingComments.splice(pendingComments.findIndex(comment => comment.uri.toString() === pendingComment.uri.toString() && Range.equalsRange(comment.range, pendingComment.range)), 1)[0];
const commentIndex = pendingComments.findIndex(comment => comment.uri.toString() === pendingComment.uri.toString() && Range.equalsRange(comment.range, pendingComment.range));
if (commentIndex > -1) {
return pendingComments.splice(commentIndex, 1)[0];
}
}
return undefined;
}
Expand Down

0 comments on commit cb9a329

Please sign in to comment.