Skip to content

Commit f6555ce

Browse files
authored
Include comment thread in command arguments (microsoft#183431)
1 parent 2c5f901 commit f6555ce

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/vs/workbench/contrib/comments/browser/commentNode.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ import { DomEmitter } from 'vs/base/browser/event';
4747
import { CommentContextKeys } from 'vs/workbench/contrib/comments/common/commentContextKeys';
4848
import { FileAccess } from 'vs/base/common/network';
4949

50+
class CommentsActionRunner extends ActionRunner {
51+
protected override async runAction(action: IAction, context: any[]): Promise<void> {
52+
await action.run(...context);
53+
}
54+
}
55+
5056
export class CommentNode<T extends IRange | ICellRange> extends Disposable {
5157
private _domNode: HTMLElement;
5258
private _body: HTMLElement;
@@ -249,11 +255,16 @@ export class CommentNode<T extends IRange | ICellRange> extends Disposable {
249255
}
250256

251257
private get commentNodeContext() {
252-
return {
258+
return [{
253259
thread: this.commentThread,
254260
commentUniqueId: this.comment.uniqueIdInThread,
255261
$mid: MarshalledId.CommentNode
256-
};
262+
},
263+
{
264+
commentControlHandle: this.commentThread.controllerHandle,
265+
commentThreadHandle: this.commentThread.commentThreadHandle,
266+
$mid: MarshalledId.CommentThread
267+
}];
257268
}
258269

259270
private createToolbar() {
@@ -278,6 +289,7 @@ export class CommentNode<T extends IRange | ICellRange> extends Disposable {
278289
});
279290

280291
this.toolbar.context = this.commentNodeContext;
292+
this.toolbar.actionRunner = new CommentsActionRunner();
281293

282294
this.registerActionBarListeners(this._actionsToolbarContainer);
283295
this._register(this.toolbar);
@@ -679,7 +691,7 @@ export class CommentNode<T extends IRange | ICellRange> extends Disposable {
679691
menuId: MenuId.CommentThreadCommentContext,
680692
menuActionOptions: { shouldForwardArgs: true },
681693
contextKeyService: this._contextKeyService,
682-
actionRunner: new ActionRunner(),
694+
actionRunner: new CommentsActionRunner(),
683695
getActionsContext: () => {
684696
return this.commentNodeContext;
685697
},

0 commit comments

Comments
 (0)