From 37966c7e5b60a0c4ab574e3ded5abb13995fa67e Mon Sep 17 00:00:00 2001 From: thewahome Date: Mon, 25 Nov 2024 14:09:17 +0300 Subject: [PATCH] show regenerate after loading api from a workspace --- .../microsoft-kiota/src/commands/editPathsCommand.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vscode/microsoft-kiota/src/commands/editPathsCommand.ts b/vscode/microsoft-kiota/src/commands/editPathsCommand.ts index 311215a8ab..80d925e1ea 100644 --- a/vscode/microsoft-kiota/src/commands/editPathsCommand.ts +++ b/vscode/microsoft-kiota/src/commands/editPathsCommand.ts @@ -1,3 +1,5 @@ +import * as vscode from 'vscode'; + import { extensionId, treeViewId } from "../constants"; import { ClientOrPluginProperties } from "../kiotaInterop"; import { OpenApiTreeProvider } from "../providers/openApiTreeProvider"; @@ -27,5 +29,14 @@ export class EditPathsCommand extends Command { private async loadEditPaths(clientOrPluginKey: string, clientOrPluginObject: ClientOrPluginProperties) { await openTreeViewWithProgress(() => this._openApiTreeProvider.loadEditPaths(clientOrPluginKey, clientOrPluginObject)); + + const regenerateAnswer = vscode.l10n.t("Regenerate"); + const response = await vscode.window.showInformationMessage( + vscode.l10n.t('Click on Regenerate after selecting the paths in the API Explorer'), + regenerateAnswer + ); + if (response === regenerateAnswer) { + await vscode.commands.executeCommand(`kiota.regenerate`); + } } }