-
Notifications
You must be signed in to change notification settings - Fork 30
Upgrading Extensions for V2 Compatibility
Alex Weininger edited this page Oct 11, 2022
·
20 revisions
Client extensions will undergo two updates related to the V2 API.
- Updates needed to make client extension compatible with V2 API, without actually consuming the V2 API.
- Full upgrade and migration to the V2 API. Lots of code changes will be required for this step.
This is a guide for part 1 of the upgrade.
- Update utils package Currently, the latest utils package is https://github.com/microsoft/vscode-azuretools/pull/1229.
- Replace
registerCommand
uses withregisterCommandWithTreeNodeUnwrapping
- Resolvers must be registered with an
AzExtResourceType
ID- The
id
argument when callingregisterApplicationResourceResolver
must be anAzExtResourceType
.
- The
- Add V2 contributions to package.json
"contributes": {
"x-azResourcesV2": {
"application": {
"branches": [
{
"type": "FunctionApp" // must match ID used to register the resolver
}
]
},
// needed if extension contributes workspace views
"workspace": {
"branches": [
{
"type": "func" // must match ID used to register the workspace resource provider
}
],
"resources": [
{
"type": "func" // must match ID used to register the workspace resource provider
}
]
}
},
- Commands should show on
azureResourceGroupsV2
view instead ofazureResourceGroups
view - Change commands attached to
azureResourceTypeGroup
tree items to useAzExtResourceType
contexts Example