From e0d94788d19f2cb18d8aada8f5fe03351e17835c Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Mon, 18 Nov 2024 10:07:01 +0300 Subject: [PATCH] Task: Correct placement of the ttk regerate app command (#5767) --- .../src/commands/regenerate/regenerateButtonCommand.ts | 7 +++---- .../src/commands/regenerate/regenerateCommand.ts | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/vscode/microsoft-kiota/src/commands/regenerate/regenerateButtonCommand.ts b/vscode/microsoft-kiota/src/commands/regenerate/regenerateButtonCommand.ts index 2830a072eb..abfcdffdac 100644 --- a/vscode/microsoft-kiota/src/commands/regenerate/regenerateButtonCommand.ts +++ b/vscode/microsoft-kiota/src/commands/regenerate/regenerateButtonCommand.ts @@ -57,15 +57,14 @@ export class RegenerateButtonCommand extends Command { if (isClientType(generationType)) { await regenerateService.regenerateClient(settings, selectedPaths); - + } + if (isPluginType(generationType)) { + await regenerateService.regeneratePlugin(settings, selectedPaths); const workspaceJson = vscode.workspace.textDocuments.find(doc => doc.fileName.endsWith(KIOTA_WORKSPACE_FILE)); if (workspaceJson && !workspaceJson.isDirty) { await regenerateService.regenerateTeamsApp(workspaceJson, clientOrPluginKey); } } - if (isPluginType(generationType)) { - await regenerateService.regeneratePlugin(settings, selectedPaths); - } } } \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/commands/regenerate/regenerateCommand.ts b/vscode/microsoft-kiota/src/commands/regenerate/regenerateCommand.ts index c28e1824d1..f121131698 100644 --- a/vscode/microsoft-kiota/src/commands/regenerate/regenerateCommand.ts +++ b/vscode/microsoft-kiota/src/commands/regenerate/regenerateCommand.ts @@ -43,12 +43,12 @@ export class RegenerateCommand extends Command { const regenerateService = new RegenerateService(this._context, this._openApiTreeProvider, clientOrPluginKey, clientOrPluginObject); if (isClientType(generationType)) { await regenerateService.regenerateClient(settings); - if (workspaceJson) { - await regenerateService.regenerateTeamsApp(workspaceJson, clientOrPluginKey); - } } if (isPluginType(generationType)) { await regenerateService.regeneratePlugin(settings); + if (workspaceJson) { + await regenerateService.regenerateTeamsApp(workspaceJson, clientOrPluginKey); + } } } } \ No newline at end of file