Skip to content

Commit

Permalink
refresh tree after deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
thewahome committed Dec 5, 2024
1 parent 14c4475 commit 457f3cd
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ export class DeleteWorkspaceItemCommand extends Command {
if (result) {
const isSuccess = result.some(k => k.message.includes('removed successfully'));
if (isSuccess) {
void vscode.window.showInformationMessage(vscode.l10n.t('{0} removed successfully.', workspaceTreeItem.label));
// add a delay to ensure the workspace tree is refreshed after the item is removed from the file
await new Promise(resolve => setTimeout(resolve, 1000));
await vscode.commands.executeCommand('kiota.workspace.refresh');
void vscode.window.showInformationMessage(vscode.l10n.t('{0} removed successfully.', workspaceTreeItem.label));
} else {
await exportLogsAndShowErrors(result, this._kiotaOutputChannel);
}
Expand Down

0 comments on commit 457f3cd

Please sign in to comment.