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:
Kevin Cunnane
2018-10-03 10:41:07 -07:00
committed by GitHub
parent 3f84e8e652
commit a77bb50b9e
70 changed files with 3955 additions and 5 deletions

View File

@@ -0,0 +1,40 @@
'use strict';
import * as vscode from 'vscode';
import MainController from './controllers/mainController';
import { AppContext } from './appContext';
import ControllerBase from './controllers/controllerBase';
import { ApiWrapper } from './apiWrapper';
let controllers: ControllerBase[] = [];
// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(extensionContext: vscode.ExtensionContext) {
let appContext = new AppContext(extensionContext, new ApiWrapper());
let activations: Promise<boolean>[] = [];
// Start the main controller
let mainController = new MainController(appContext);
controllers.push(mainController);
extensionContext.subscriptions.push(mainController);
activations.push(mainController.activate());
return Promise.all(activations)
.then((results: boolean[]) => {
for (let result of results) {
if (!result) {
return false;
}
}
return true;
});
}
// this method is called when your extension is deactivated
export function deactivate() {
for (let controller of controllers) {
controller.deactivate();
}
}