mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-22 12:50:29 -04:00
Port the Azure Resource Explorer extension to core. (#2701)
* Port the Azure Resource Explorer extension to core. This will enable Azure viewlet by default in the next release. - Moving this code from the SQL Server 2019 extension to Azure Data Studio core - Ported tests and verified they work in the integration tests.sh file - Fixed an issue that caused integration tests to fail if you have a SQL Server 2019 big data cluster endpoint listed, but the extension isn't installed.
This commit is contained in:
34
extensions/azurecore/src/controllers/controllerBase.ts
Normal file
34
extensions/azurecore/src/controllers/controllerBase.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
import { AppContext } from '../appContext';
|
||||
import { ApiWrapper } from '../apiWrapper';
|
||||
|
||||
export default abstract class ControllerBase implements vscode.Disposable {
|
||||
|
||||
public constructor(protected appContext: AppContext) {
|
||||
}
|
||||
|
||||
protected get apiWrapper(): ApiWrapper {
|
||||
return this.appContext.apiWrapper;
|
||||
}
|
||||
|
||||
public get extensionContext(): vscode.ExtensionContext {
|
||||
return this.appContext && this.appContext.extensionContext;
|
||||
}
|
||||
|
||||
abstract activate(): Promise<boolean>;
|
||||
|
||||
abstract deactivate(): void;
|
||||
|
||||
public dispose(): void {
|
||||
this.deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user