mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
clean up some disposable use (#6832)
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import * as azdata from 'azdata';
|
||||
import { Deferred } from 'sql/base/common/promise';
|
||||
|
||||
@@ -21,7 +21,7 @@ export interface CredentialManagementEvents {
|
||||
export const ICredentialsService = createDecorator<ICredentialsService>(SERVICE_ID);
|
||||
|
||||
export interface ICredentialsService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: ServiceIdentifier<ICredentialsService>;
|
||||
|
||||
saveCredential(credentialId: string, password: string): Promise<boolean>;
|
||||
|
||||
@@ -34,9 +34,7 @@ export interface ICredentialsService {
|
||||
|
||||
export class CredentialsService implements ICredentialsService {
|
||||
|
||||
_serviceBrand: any;
|
||||
|
||||
private disposables: IDisposable[] = [];
|
||||
_serviceBrand: ServiceIdentifier<ICredentialsService>;
|
||||
|
||||
private _serverEvents: { [handle: number]: CredentialManagementEvents; } = Object.create(null);
|
||||
|
||||
@@ -71,8 +69,4 @@ export class CredentialsService implements ICredentialsService {
|
||||
public deleteCredential(credentialId: string): Promise<boolean> {
|
||||
return this._onServerEventsReady.promise.then(() => this._serverEvents[this._lastHandle].onDeleteCredential(credentialId));
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.disposables = dispose(this.disposables);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
@@ -13,7 +12,7 @@ export const SERVICE_ID = 'metadataService';
|
||||
export const IMetadataService = createDecorator<IMetadataService>(SERVICE_ID);
|
||||
|
||||
export interface IMetadataService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: ServiceIdentifier<IMetadataService>;
|
||||
|
||||
getMetadata(connectionUri: string): Thenable<azdata.ProviderMetadata>;
|
||||
|
||||
@@ -31,9 +30,7 @@ export interface IMetadataService {
|
||||
|
||||
export class MetadataService implements IMetadataService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
|
||||
private _disposables: IDisposable[] = [];
|
||||
public _serviceBrand: ServiceIdentifier<IMetadataService>;
|
||||
|
||||
private _providers: { [handle: string]: azdata.MetadataProvider; } = Object.create(null);
|
||||
|
||||
@@ -94,8 +91,4 @@ export class MetadataService implements IMetadataService {
|
||||
public registerProvider(providerId: string, provider: azdata.MetadataProvider): void {
|
||||
this._providers[providerId] = provider;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._disposables = dispose(this._disposables);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import * as azdata from 'azdata';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
@@ -24,7 +23,7 @@ export enum ScriptOperation {
|
||||
}
|
||||
|
||||
export interface IScriptingService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: ServiceIdentifier<IScriptingService>;
|
||||
|
||||
script(connectionUri: string, metadata: azdata.ObjectMetadata, operation: ScriptOperation, paramDetails: azdata.ScriptingParamDetails): Thenable<azdata.ScriptingResult>;
|
||||
|
||||
@@ -51,9 +50,7 @@ export interface IScriptingService {
|
||||
|
||||
export class ScriptingService implements IScriptingService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
|
||||
private disposables: IDisposable[] = [];
|
||||
public _serviceBrand: ServiceIdentifier<IScriptingService>;
|
||||
|
||||
private _providers: { [handle: string]: azdata.ScriptingProvider; } = Object.create(null);
|
||||
|
||||
@@ -113,8 +110,4 @@ export class ScriptingService implements IScriptingService {
|
||||
let provider = this._providers[providerId];
|
||||
return !!provider;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.disposables = dispose(this.disposables);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
|
||||
import * as azdata from 'azdata';
|
||||
@@ -40,7 +39,7 @@ export interface SerializeDataParams {
|
||||
}
|
||||
|
||||
export interface ISerializationService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: ServiceIdentifier<ISerializationService>;
|
||||
|
||||
registerProvider(providerId: string, provider: azdata.SerializationProvider): void;
|
||||
|
||||
@@ -62,9 +61,7 @@ function getBatchSize(totalRows: number, currentIndex: number): number {
|
||||
|
||||
export class SerializationService implements ISerializationService {
|
||||
|
||||
_serviceBrand: any;
|
||||
|
||||
private disposables: IDisposable[] = [];
|
||||
_serviceBrand: ServiceIdentifier<ISerializationService>;
|
||||
|
||||
private providers: { providerId: string, provider: azdata.SerializationProvider }[] = [];
|
||||
|
||||
@@ -197,8 +194,4 @@ export class SerializationService implements ISerializationService {
|
||||
};
|
||||
return continueSerializeRequest;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.disposables = dispose(this.disposables);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user