mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05: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:
40
extensions/azurecore/src/extension.ts
Normal file
40
extensions/azurecore/src/extension.ts
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user