Merge branch 'master' into command-execute-events

This commit is contained in:
Johannes Rieken
2019-06-28 17:06:31 +02:00
committed by GitHub
1408 changed files with 71729 additions and 28694 deletions

View File

@@ -12,7 +12,7 @@ import { revive } from 'vs/base/common/marshalling';
@extHostNamedCustomer(MainContext.MainThreadCommands)
export class MainThreadCommands implements MainThreadCommandsShape {
private readonly _disposables = new Map<string, IDisposable>();
private readonly _commandRegistrations = new Map<string, IDisposable>();
private readonly _generateCommandsDocumentationRegistration: IDisposable;
private readonly _proxy: ExtHostCommandsShape;
private _onDidExecuteCommandListener?: IDisposable;
@@ -27,8 +27,8 @@ export class MainThreadCommands implements MainThreadCommandsShape {
}
dispose() {
this._disposables.forEach(value => value.dispose());
this._disposables.clear();
this._commandRegistrations.forEach(value => value.dispose());
this._commandRegistrations.clear();
this._generateCommandsDocumentationRegistration.dispose();
}
@@ -54,7 +54,7 @@ export class MainThreadCommands implements MainThreadCommandsShape {
}
$registerCommand(id: string): void {
this._disposables.set(
this._commandRegistrations.set(
id,
CommandsRegistry.registerCommand(id, (accessor, ...args) => {
return this._proxy.$executeContributedCommand(id, ...args).then(result => {
@@ -65,10 +65,10 @@ export class MainThreadCommands implements MainThreadCommandsShape {
}
$unregisterCommand(id: string): void {
const command = this._disposables.get(id);
const command = this._commandRegistrations.get(id);
if (command) {
command.dispose();
this._disposables.delete(id);
this._commandRegistrations.delete(id);
}
}