Fix deployment warnings to only show if no resources found (#10878)

This commit is contained in:
Charles Gagnon
2020-06-11 17:07:19 -07:00
committed by GitHub
parent 4322234d0b
commit 8db272cea4
14 changed files with 205 additions and 123 deletions

View File

@@ -5,6 +5,7 @@
import * as vscode from 'vscode';
import * as azdata from 'azdata';
import * as azurecore from '../../../azurecore/src/azurecore';
/**
* Wrapper class to act as a facade over VSCode and Data APIs and allow us to test / mock callbacks into
@@ -137,4 +138,16 @@ export class ApiWrapper {
public registerWidget(widgetId: string, handler: (view: azdata.ModelView) => void): void {
azdata.ui.registerModelViewProvider(widgetId, handler);
}
private azurecoreApi: azurecore.IExtension | undefined;
public async getAzurecoreApi(): Promise<azurecore.IExtension> {
if (!this.azurecoreApi) {
this.azurecoreApi = await this.getExtension(azurecore.extension.name)?.activate();
if (!this.azurecoreApi) {
throw new Error('Unable to retrieve azurecore API');
}
}
return this.azurecoreApi;
}
}