mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-07 09:35:41 -05:00
Fix deployment warnings to only show if no resources found (#10878)
This commit is contained in:
30
extensions/resource-deployment/src/services/apiService.ts
Normal file
30
extensions/resource-deployment/src/services/apiService.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azurecore from '../../../azurecore/src/azurecore';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
export interface IApiService {
|
||||
getAzurecoreApi(): Promise<azurecore.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;
|
||||
}
|
||||
}
|
||||
|
||||
export const apiService: IApiService = new ApiService();
|
||||
Reference in New Issue
Block a user