From 2bdc23334ce825e82272b3cf03c74da4588577e9 Mon Sep 17 00:00:00 2001 From: thewahome Date: Wed, 11 Dec 2024 16:11:00 +0300 Subject: [PATCH 1/2] remove setting the icons --- vscode/microsoft-kiota/src/providers/openApiTreeProvider.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/vscode/microsoft-kiota/src/providers/openApiTreeProvider.ts b/vscode/microsoft-kiota/src/providers/openApiTreeProvider.ts index 56622108b4..8b433d01f9 100644 --- a/vscode/microsoft-kiota/src/providers/openApiTreeProvider.ts +++ b/vscode/microsoft-kiota/src/providers/openApiTreeProvider.ts @@ -353,7 +353,6 @@ export class OpenApiTreeProvider implements vscode.TreeDataProvider Date: Wed, 11 Dec 2024 16:11:49 +0300 Subject: [PATCH 2/2] update icons correctly --- .../microsoft-kiota/src/commands/editPathsCommand.ts | 10 +++++++--- .../searchOrOpenApiDescriptionCommand.ts | 6 +++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/vscode/microsoft-kiota/src/commands/editPathsCommand.ts b/vscode/microsoft-kiota/src/commands/editPathsCommand.ts index f15882825c..e2eb7c6060 100644 --- a/vscode/microsoft-kiota/src/commands/editPathsCommand.ts +++ b/vscode/microsoft-kiota/src/commands/editPathsCommand.ts @@ -24,12 +24,16 @@ export class EditPathsCommand extends Command { public async execute({ clientOrPluginKey, clientOrPluginObject }: Partial): Promise { await this.loadEditPaths(clientOrPluginKey!, clientOrPluginObject!); this.openApiTreeProvider.resetInitialState(); - await updateTreeViewIcons(treeViewId, false, true); - await vscode.commands.executeCommand('kiota.workspace.refresh'); } private async loadEditPaths(clientOrPluginKey: string, clientOrPluginObject: ClientOrPluginProperties) { - await openTreeViewWithProgress(() => this.openApiTreeProvider.loadEditPaths(clientOrPluginKey, clientOrPluginObject)); + await openTreeViewWithProgress( + async () => { + await this.openApiTreeProvider.loadEditPaths(clientOrPluginKey, clientOrPluginObject); + await updateTreeViewIcons(treeViewId, false, true); + await vscode.commands.executeCommand('kiota.workspace.refresh'); + } + ); const regenerateAnswer = vscode.l10n.t("Regenerate"); const showGenerateMessage = this.context.globalState.get(SHOW_MESSAGE_AFTER_API_LOAD, true); diff --git a/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts b/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts index 4dbca1de20..a4eec01cc3 100644 --- a/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts +++ b/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts @@ -6,6 +6,7 @@ import { setDeepLinkParams } from "../../handlers/deepLinkParamsHandler"; import { searchSteps } from "../../modules/steps/searchSteps"; import { OpenApiTreeProvider } from "../../providers/openApiTreeProvider"; import { getExtensionSettings } from "../../types/extensionSettings"; +import { updateTreeViewIcons } from "../../util"; import { IntegrationParams, validateDeepLinkQueryParams } from "../../utilities/deep-linking"; import { openTreeViewWithProgress } from "../../utilities/progress"; import { Command } from "../Command"; @@ -60,7 +61,10 @@ export class SearchOrOpenApiDescriptionCommand extends Command { })); if (config.descriptionPath) { - await openTreeViewWithProgress(() => this.openApiTreeProvider.setDescriptionUrl(config.descriptionPath!)); + await openTreeViewWithProgress(async () => { + await this.openApiTreeProvider.setDescriptionUrl(config.descriptionPath!); + await updateTreeViewIcons(treeViewId, true, false); + }); const generateAnswer = vscode.l10n.t("Generate"); const showGenerateMessage = this.context.globalState.get(SHOW_MESSAGE_AFTER_API_LOAD, true);