mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 09:35:38 -05:00
controller dropdown field to SQL MIAA and Postgres deployment. (#12217)
* saving first draft * throw if no controllers * cleanup * bug fixes * bug fixes and caching controller access * pr comments and bug fixes. * fixes * fixes * comment fix * remove debug prints * comment fixes * remove debug logs * inputValueTransformer returns string|Promise * PR feedback * pr fixes * remove _ from protected fields * anonymous to full methods * small fixes
This commit is contained in:
@@ -5,26 +5,17 @@
|
||||
|
||||
import * as azurecore from 'azurecore';
|
||||
import * as vscode from 'vscode';
|
||||
import * as arc from 'arc';
|
||||
|
||||
export interface IApiService {
|
||||
getAzurecoreApi(): Promise<azurecore.IExtension>;
|
||||
readonly azurecoreApi: azurecore.IExtension;
|
||||
readonly arcApi: arc.IExtension;
|
||||
}
|
||||
|
||||
class ApiService implements IApiService {
|
||||
|
||||
private azurecoreApi: azurecore.IExtension | undefined;
|
||||
|
||||
constructor() { }
|
||||
|
||||
public async getAzurecoreApi(): Promise<azurecore.IExtension> {
|
||||
if (!this.azurecoreApi) {
|
||||
this.azurecoreApi = <azurecore.IExtension>(await vscode.extensions.getExtension(azurecore.extension.name)?.activate());
|
||||
if (!this.azurecoreApi) {
|
||||
throw new Error('Unable to retrieve azurecore API');
|
||||
}
|
||||
}
|
||||
return this.azurecoreApi;
|
||||
}
|
||||
public get azurecoreApi() { return vscode.extensions.getExtension(azurecore.extension.name)?.exports; }
|
||||
public get arcApi() { return vscode.extensions.getExtension(arc.extension.name)?.exports; }
|
||||
}
|
||||
|
||||
export const apiService: IApiService = new ApiService();
|
||||
|
||||
Reference in New Issue
Block a user