From 457f3cdfb9bf4cac8e1f1878ab2e56d5c7cb5991 Mon Sep 17 00:00:00 2001 From: thewahome Date: Thu, 5 Dec 2024 14:50:02 +0300 Subject: [PATCH] refresh tree after deleting --- .../deleteWorkspaceItem/deleteWorkspaceItemCommand.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts b/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts index bc6dd91a41..cb1bf35ca4 100644 --- a/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts +++ b/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts @@ -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); }