clean up some disposable use (#6832)

This commit is contained in:
Anthony Dresser
2019-08-20 14:34:13 -07:00
committed by GitHub
parent 54cf062737
commit c540e81108
23 changed files with 139 additions and 244 deletions

View File

@@ -3,32 +3,22 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { SqlExtHostContext, SqlMainContext, ExtHostObjectExplorerShape, MainThreadObjectExplorerShape } from 'sql/workbench/api/common/sqlExtHost.protocol';
import { SqlMainContext, MainThreadObjectExplorerShape } from 'sql/workbench/api/common/sqlExtHost.protocol';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IObjectExplorerService, NodeInfoWithConnection } from 'sql/workbench/services/objectExplorer/common/objectExplorerService';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { Disposable } from 'vs/base/common/lifecycle';
@extHostNamedCustomer(SqlMainContext.MainThreadObjectExplorer)
export class MainThreadObjectExplorer implements MainThreadObjectExplorerShape {
private _proxy: ExtHostObjectExplorerShape;
private _toDispose: IDisposable[];
export class MainThreadObjectExplorer extends Disposable implements MainThreadObjectExplorerShape {
constructor(
extHostContext: IExtHostContext,
@IObjectExplorerService private _objectExplorerService: IObjectExplorerService,
) {
if (extHostContext) {
this._proxy = extHostContext.getProxy(SqlExtHostContext.ExtHostObjectExplorer);
}
this._toDispose = [];
}
public dispose(): void {
this._toDispose = dispose(this._toDispose);
super();
}
public $getNode(connectionId: string, nodePath?: string): Thenable<azdata.NodeInfo> {