Fix dipose "method not implemented" errors in MainThread API classes (#15257)

This commit is contained in:
Charles Gagnon
2021-04-28 09:39:04 -07:00
committed by GitHub
parent 2cf15b51f9
commit 57cd25fab9
4 changed files with 14 additions and 22 deletions

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IDisposable } from 'vs/base/common/lifecycle';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import {
@@ -20,23 +20,21 @@ import { ConnectionProfile } from 'sql/platform/connection/common/connectionProf
import { TaskRegistry } from 'sql/workbench/services/tasks/browser/tasksRegistry';
@extHostNamedCustomer(SqlMainContext.MainThreadTasks)
export class MainThreadTasks implements MainThreadTasksShape {
export class MainThreadTasks extends Disposable implements MainThreadTasksShape {
private readonly _disposables = new Map<string, IDisposable>();
private readonly _generateCommandsDocumentationRegistration: IDisposable;
private readonly _proxy: ExtHostTasksShape;
constructor(
extHostContext: IExtHostContext
) {
super();
this._proxy = extHostContext.getProxy(SqlExtHostContext.ExtHostTasks);
}
dispose() {
this._disposables.forEach(value => value.dispose());
this._disposables.clear();
this._generateCommandsDocumentationRegistration.dispose();
}
$registerTask(id: string): Promise<any> {