mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
defining arc api (#12153)
* defining arcApi * pr feedback * activate arc extension in test * skip failing test temporarily * remove arcService test file
This commit is contained in:
@@ -3,15 +3,16 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as arc from 'arc';
|
||||
import * as vscode from 'vscode';
|
||||
import * as loc from './localizedConstants';
|
||||
import { IconPathHelper, refreshActionId } from './constants';
|
||||
import * as loc from './localizedConstants';
|
||||
import { ConnectToControllerDialog } from './ui/dialogs/connectControllerDialog';
|
||||
import { AzureArcTreeDataProvider } from './ui/tree/azureArcTreeDataProvider';
|
||||
import { ControllerTreeNode } from './ui/tree/controllerTreeNode';
|
||||
import { TreeNode } from './ui/tree/treeNode';
|
||||
import { ConnectToControllerDialog } from './ui/dialogs/connectControllerDialog';
|
||||
|
||||
export async function activate(context: vscode.ExtensionContext): Promise<void> {
|
||||
export async function activate(context: vscode.ExtensionContext): Promise<arc.IExtension> {
|
||||
IconPathHelper.setExtensionContext(context);
|
||||
|
||||
await vscode.commands.executeCommand('setContext', 'arc.loaded', false);
|
||||
@@ -54,6 +55,15 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
|
||||
});
|
||||
|
||||
await checkArcDeploymentExtension();
|
||||
|
||||
return {
|
||||
getRegisteredDataControllers: async () => {
|
||||
return (await treeDataProvider.getChildren())
|
||||
.filter(node => node instanceof ControllerTreeNode)
|
||||
.map(node => (node as ControllerTreeNode).model.info);
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function deactivate(): void {
|
||||
@@ -62,7 +72,7 @@ export function deactivate(): void {
|
||||
async function checkArcDeploymentExtension(): Promise<void> {
|
||||
const version = vscode.extensions.getExtension('Microsoft.arcdeployment')?.packageJSON.version;
|
||||
if (version && version !== '0.3.2') {
|
||||
// If we have an older verison of the deployment extension installed then uninstall it now since it's replaced
|
||||
// If we have an older version of the deployment extension installed then uninstall it now since it's replaced
|
||||
// by this extension. (the latest version of the Arc Deployment extension will uninstall itself so don't do
|
||||
// anything here if that's already updated)
|
||||
await vscode.commands.executeCommand('workbench.extensions.uninstallExtension', 'Microsoft.arcdeployment');
|
||||
|
||||
Reference in New Issue
Block a user