Change shutdown listeners (#4282)

* change shutdown to use proper notification

* change to use storage service

* remove unused imports

* fix test

* change shutdown methods to private

* remove unusde imports

* fix tests

* formatting
This commit is contained in:
Anthony Dresser
2019-03-13 15:15:51 -07:00
committed by GitHub
parent 08d4cc9690
commit b6584c9ddf
16 changed files with 51 additions and 43 deletions

View File

@@ -35,7 +35,6 @@ export interface IAccountManagementService {
// SERVICE MANAGEMENT METHODS /////////////////////////////////////////
registerProvider(providerMetadata: azdata.AccountProviderMetadata, provider: azdata.AccountProvider): void;
shutdown(): void;
unregisterProvider(providerMetadata: azdata.AccountProviderMetadata): void;
// EVENTING ////////////////////////////////////////////////////////////

View File

@@ -131,6 +131,8 @@ export class CapabilitiesService extends Disposable implements ICapabilitiesServ
this.cleanupProviders();
});
_storageService.onWillSaveState(() => this.shutdown());
this._register(extentionManagementService.onDidUninstallExtension(({ identifier }) => {
const connectionProvider = 'connectionProvider';
let extensionid = getIdFromLocalExtensionId(identifier.id);
@@ -239,7 +241,7 @@ export class CapabilitiesService extends Disposable implements ICapabilitiesServ
}
}
public shutdown(): void {
private shutdown(): void {
this._momento.saveMemento();
}
}

View File

@@ -141,6 +141,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
this.onConnectionChanged(() => this.refreshEditorTitles());
this.onConnect(() => this.refreshEditorTitles());
this.onDisconnect(() => this.refreshEditorTitles());
_storageService.onWillSaveState(() => this.shutdown());
}
public providerRegistered(providerId: string): boolean {
@@ -936,7 +937,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
public onIntelliSenseCacheComplete(handle: number, connectionUri: string): void {
}
public shutdown(): void {
private shutdown(): void {
this._connectionStore.clearActiveConnections();
this._connectionMemento.saveMemento();
}