Have resource deployment providers return disposables (#13690)

* Add dependent field provider to resource deployment

* Change name to value provider service

* Add error handling

* providerId -> id

* Set dropdown value correctly

* missed id

* back to providerId

* fix updating missed id

* Make resource deployment providers disposable
This commit is contained in:
Charles Gagnon
2020-12-07 10:27:37 -08:00
committed by GitHub
parent a70dce7855
commit 97a4de4111
6 changed files with 25 additions and 8 deletions

View File

@@ -109,7 +109,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<azurec
// Don't block on this since there's a bit of a circular dependency here with the extension activation since resource deployment
// depends on this extension too. It's fine to wait a bit for that to finish before registering the provider
vscode.extensions.getExtension(resourceDeployment.extension.name).activate().then((api: resourceDeployment.IExtension) => {
api.registerValueProvider({
context.subscriptions.push(api.registerValueProvider({
id: 'subscription-id-to-tenant-id',
getValue: async (triggerValue: string) => {
if (triggerValue === '') {
@@ -137,7 +137,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<azurec
console.error(`Unable to find subscription with ID ${triggerValue} when mapping subscription ID to tenant ID`);
return '';
}
});
}));
});
return {