diff --git a/src/commands/registerCommands.ts b/src/commands/registerCommands.ts index 87f58598e..fb852fb74 100644 --- a/src/commands/registerCommands.ts +++ b/src/commands/registerCommands.ts @@ -8,6 +8,7 @@ import { commands } from 'vscode'; import { ext } from '../extensionVariables'; import { BranchDataItemWrapper } from '../tree/BranchDataProviderItem'; import { ResourceGroupsItem } from '../tree/ResourceGroupsItem'; +import { GroupingItem } from '../tree/azure/GroupingItem'; import { clearActivities } from './activities/clearActivities'; import { createResource } from './createResource'; import { createResourceGroup } from './createResourceGroup'; @@ -31,7 +32,12 @@ export function registerCommands(): void { // v1.5 client extensions attach these commands to tree item context menus for refreshing their tree items registerCommand('azureResourceGroups.refresh', async (context, node?: ResourceGroupsItem) => { await handleAzExtTreeItemRefresh(context, node); // for compatibility with v1.5 client extensions - ext.actions.refreshAzureTree(node); + + if (node instanceof GroupingItem) { + ext.actions.refreshAzureTree(node.parent); + } else { + ext.actions.refreshAzureTree(node); + } }); registerCommand('azureWorkspace.refresh', async (context, node?: ResourceGroupsItem) => { await handleAzExtTreeItemRefresh(context, node); // for compatibility with v1.5 client extensions