diff --git a/vscode/microsoft-kiota/src/commands/regenerate/regenerateButtonCommand.ts b/vscode/microsoft-kiota/src/commands/regenerate/regenerateButtonCommand.ts index 25ad81022b..2830a072eb 100644 --- a/vscode/microsoft-kiota/src/commands/regenerate/regenerateButtonCommand.ts +++ b/vscode/microsoft-kiota/src/commands/regenerate/regenerateButtonCommand.ts @@ -1,7 +1,7 @@ import * as vscode from "vscode"; import { ExtensionContext } from "vscode"; -import { extensionId, treeViewId } from "../../constants"; +import { extensionId, KIOTA_WORKSPACE_FILE, treeViewId } from "../../constants"; import { getGenerationConfiguration, setGenerationConfiguration } from "../../handlers/configurationHandler"; import { OpenApiTreeProvider } from "../../providers/openApiTreeProvider"; import { getExtensionSettings } from "../../types/extensionSettings"; @@ -57,6 +57,11 @@ export class RegenerateButtonCommand extends Command { if (isClientType(generationType)) { await regenerateService.regenerateClient(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); diff --git a/vscode/microsoft-kiota/src/commands/regenerate/regenerateCommand.ts b/vscode/microsoft-kiota/src/commands/regenerate/regenerateCommand.ts index a2688351d0..c28e1824d1 100644 --- a/vscode/microsoft-kiota/src/commands/regenerate/regenerateCommand.ts +++ b/vscode/microsoft-kiota/src/commands/regenerate/regenerateCommand.ts @@ -43,10 +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); } } - } \ No newline at end of file