mirror of
https://github.com/coder/code-server.git
synced 2026-05-05 12:05:18 +02:00
Update to VS Code 1.52.1
This commit is contained in:
@@ -36,7 +36,7 @@ export interface IAction extends IDisposable {
|
||||
export interface IActionRunner extends IDisposable {
|
||||
run(action: IAction, context?: any): Promise<any>;
|
||||
readonly onDidRun: Event<IRunEvent>;
|
||||
readonly onDidBeforeRun: Event<IRunEvent>;
|
||||
readonly onBeforeRun: Event<IRunEvent>;
|
||||
}
|
||||
|
||||
export interface IActionViewItem extends IDisposable {
|
||||
@@ -178,8 +178,8 @@ export interface IRunEvent {
|
||||
|
||||
export class ActionRunner extends Disposable implements IActionRunner {
|
||||
|
||||
private _onDidBeforeRun = this._register(new Emitter<IRunEvent>());
|
||||
readonly onDidBeforeRun: Event<IRunEvent> = this._onDidBeforeRun.event;
|
||||
private _onBeforeRun = this._register(new Emitter<IRunEvent>());
|
||||
readonly onBeforeRun: Event<IRunEvent> = this._onBeforeRun.event;
|
||||
|
||||
private _onDidRun = this._register(new Emitter<IRunEvent>());
|
||||
readonly onDidRun: Event<IRunEvent> = this._onDidRun.event;
|
||||
@@ -189,7 +189,7 @@ export class ActionRunner extends Disposable implements IActionRunner {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
||||
this._onDidBeforeRun.fire({ action: action });
|
||||
this._onBeforeRun.fire({ action: action });
|
||||
|
||||
try {
|
||||
const result = await this.runAction(action, context);
|
||||
@@ -235,6 +235,17 @@ export class Separator extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
export class ActionWithMenuAction extends Action {
|
||||
|
||||
get actions(): IAction[] {
|
||||
return this._actions;
|
||||
}
|
||||
|
||||
constructor(id: string, private _actions: IAction[], label?: string, cssClass?: string, enabled?: boolean, actionCallback?: (event?: any) => Promise<any>) {
|
||||
super(id, label, cssClass, enabled, actionCallback);
|
||||
}
|
||||
}
|
||||
|
||||
export class SubmenuAction extends Action {
|
||||
|
||||
get actions(): IAction[] {
|
||||
@@ -242,7 +253,7 @@ export class SubmenuAction extends Action {
|
||||
}
|
||||
|
||||
constructor(id: string, label: string, private _actions: IAction[], cssClass?: string) {
|
||||
super(id, label, cssClass, true);
|
||||
super(id, label, cssClass, !!_actions?.length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user