mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-08 17:54:23 +01:00
Include comment thread in command arguments (#183431)
This commit is contained in:
@@ -47,6 +47,12 @@ import { DomEmitter } from 'vs/base/browser/event';
|
||||
import { CommentContextKeys } from 'vs/workbench/contrib/comments/common/commentContextKeys';
|
||||
import { FileAccess } from 'vs/base/common/network';
|
||||
|
||||
class CommentsActionRunner extends ActionRunner {
|
||||
protected override async runAction(action: IAction, context: any[]): Promise<void> {
|
||||
await action.run(...context);
|
||||
}
|
||||
}
|
||||
|
||||
export class CommentNode<T extends IRange | ICellRange> extends Disposable {
|
||||
private _domNode: HTMLElement;
|
||||
private _body: HTMLElement;
|
||||
@@ -249,11 +255,16 @@ export class CommentNode<T extends IRange | ICellRange> extends Disposable {
|
||||
}
|
||||
|
||||
private get commentNodeContext() {
|
||||
return {
|
||||
return [{
|
||||
thread: this.commentThread,
|
||||
commentUniqueId: this.comment.uniqueIdInThread,
|
||||
$mid: MarshalledId.CommentNode
|
||||
};
|
||||
},
|
||||
{
|
||||
commentControlHandle: this.commentThread.controllerHandle,
|
||||
commentThreadHandle: this.commentThread.commentThreadHandle,
|
||||
$mid: MarshalledId.CommentThread
|
||||
}];
|
||||
}
|
||||
|
||||
private createToolbar() {
|
||||
@@ -278,6 +289,7 @@ export class CommentNode<T extends IRange | ICellRange> extends Disposable {
|
||||
});
|
||||
|
||||
this.toolbar.context = this.commentNodeContext;
|
||||
this.toolbar.actionRunner = new CommentsActionRunner();
|
||||
|
||||
this.registerActionBarListeners(this._actionsToolbarContainer);
|
||||
this._register(this.toolbar);
|
||||
@@ -679,7 +691,7 @@ export class CommentNode<T extends IRange | ICellRange> extends Disposable {
|
||||
menuId: MenuId.CommentThreadCommentContext,
|
||||
menuActionOptions: { shouldForwardArgs: true },
|
||||
contextKeyService: this._contextKeyService,
|
||||
actionRunner: new ActionRunner(),
|
||||
actionRunner: new CommentsActionRunner(),
|
||||
getActionsContext: () => {
|
||||
return this.commentNodeContext;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user