Revert "Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d (#5949)" (#5983)

This reverts commit d15a3fcc98.
This commit is contained in:
Karl Burtram
2019-06-11 12:35:58 -07:00
committed by GitHub
parent 95a50b7892
commit 5a7562a37b
926 changed files with 11394 additions and 19540 deletions

View File

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