diff --git a/vscode/microsoft-kiota/src/extension.ts b/vscode/microsoft-kiota/src/extension.ts index 73f3e1846c..046df51742 100644 --- a/vscode/microsoft-kiota/src/extension.ts +++ b/vscode/microsoft-kiota/src/extension.ts @@ -135,12 +135,14 @@ export async function activate( } let languagesInformation = await getLanguageInformation(context); + const pluginName = getPluginName(); config = await generateSteps( { clientClassName: openApiTreeProvider.clientClassName, clientNamespaceName: openApiTreeProvider.clientNamespaceName, language: openApiTreeProvider.language, outputPath: openApiTreeProvider.outputPath, + pluginName }, languagesInformation ); @@ -188,6 +190,12 @@ export async function activate( await displayGenerationResults(context, openApiTreeProvider, config); } } + function getPluginName(): string | undefined { + if (openApiTreeProvider.apiTitle) { + return openApiTreeProvider.apiTitle.replace(/[^a-zA-Z0-9_]+/g, ''); + } + return undefined; + } } ), vscode.workspace.onDidChangeWorkspaceFolders(async () => { diff --git a/vscode/microsoft-kiota/src/openApiTreeProvider.ts b/vscode/microsoft-kiota/src/openApiTreeProvider.ts index 0ee2cc8283..1c852d698e 100644 --- a/vscode/microsoft-kiota/src/openApiTreeProvider.ts +++ b/vscode/microsoft-kiota/src/openApiTreeProvider.ts @@ -23,7 +23,7 @@ import { updateTreeViewIcons } from './util'; export class OpenApiTreeProvider implements vscode.TreeDataProvider { private _onDidChangeTreeData: vscode.EventEmitter = new vscode.EventEmitter(); readonly onDidChangeTreeData: vscode.Event = this._onDidChangeTreeData.event; - private apiTitle?: string; + public apiTitle?: string; private initialStateHash: string = ''; constructor( private readonly context: vscode.ExtensionContext,