Remove disposable from connection (#22687)

* Remove disposable from connection

* Remove from group
This commit is contained in:
Charles Gagnon
2023-04-11 15:27:01 -07:00
committed by GitHub
parent 219bdabfb2
commit df88d881c5
11 changed files with 10 additions and 63 deletions

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Disposable } from 'vs/base/common/lifecycle';
import { isString } from 'vs/base/common/types';
import * as azdata from 'azdata';
@@ -14,7 +13,7 @@ import { localize } from 'vs/nls';
type SettableProperty = 'serverName' | 'authenticationType' | 'databaseName' | 'password' | 'connectionName' | 'userName';
export class ProviderConnectionInfo extends Disposable implements azdata.ConnectionInfo {
export class ProviderConnectionInfo implements azdata.ConnectionInfo {
options: { [name: string]: any } = {};
@@ -25,7 +24,6 @@ export class ProviderConnectionInfo extends Disposable implements azdata.Connect
protected capabilitiesService: ICapabilitiesService,
model: string | azdata.IConnectionProfile | azdata.connection.ConnectionProfile | undefined
) {
super();
// we can't really do a whole lot if we don't have a provider
if (model) {
this.providerName = isString(model) ? model : 'providerName' in model ? model.providerName : model.providerId;
@@ -69,14 +67,6 @@ export class ProviderConnectionInfo extends Disposable implements azdata.Connect
this._providerName = name;
}
public override dispose(): void {
// Notes:
// 1. It is not recommended to add disposables to this class considering the way we create and use the connection objects,
// there are places that the connection objects are not being disposed properly.
// 2. Remember to dispose the listeners added to this class.
super.dispose();
}
public clone(): ProviderConnectionInfo {
let instance = new ProviderConnectionInfo(this.capabilitiesService, this.providerName);
instance.options = Object.assign({}, this.options);