提交 ab769475 编写于 作者: H Harry Hedger

renamed listeners to registerCommandListener and unregisterCommandListener

上级 62f2b712
......@@ -79,11 +79,11 @@ export class MainThreadCommands implements MainThreadCommandsShape {
return this._commandService.executeCommand<T>(id, ...args);
}
$onDidExecuteCommand() {
$registerCommandListener() {
this._onDidExecuteCommandListener = this._commandService.onDidExecuteCommand((command) => this.handleExecuteCommand(command));
}
$disposeListener() {
$unregisterCommandListener() {
return this._onDidExecuteCommandListener.dispose();
}
......
......@@ -113,8 +113,8 @@ export interface MainThreadClipboardShape extends IDisposable {
export interface MainThreadCommandsShape extends IDisposable {
$registerCommand(id: string): void;
$onDidExecuteCommand(): void;
$disposeListener(): void;
$registerCommandListener(): void;
$unregisterCommandListener(): void;
$unregisterCommand(id: string): void;
$executeCommand<T>(id: string, args: any[]): Promise<T | undefined>;
$getCommands(): Promise<string[]>;
......
......@@ -48,8 +48,8 @@ export class ExtHostCommands implements ExtHostCommandsShape {
) {
this._proxy = mainContext.getProxy(MainContext.MainThreadCommands);
this._onDidExecuteCommand = new Emitter<ICommandEvent>({
onFirstListenerDidAdd: this._proxy.$onDidExecuteCommand,
onLastListenerRemove: this._proxy.$disposeListener,
onFirstListenerDidAdd: () => this._proxy.$registerCommandListener(),
onLastListenerRemove: () => this._proxy.$unregisterCommandListener(),
});
this.onDidExecuteCommandEmitter = this._onDidExecuteCommand.event;
this._logService = logService;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册