Skip to content

Commit

Permalink
Task: default plugin name (#5191)
Browse files Browse the repository at this point in the history
  • Loading branch information
thewahome authored Aug 26, 2024
1 parent e016d91 commit bc68b4f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions vscode/microsoft-kiota/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down Expand Up @@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion vscode/microsoft-kiota/src/openApiTreeProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { updateTreeViewIcons } from './util';
export class OpenApiTreeProvider implements vscode.TreeDataProvider<OpenApiTreeNode> {
private _onDidChangeTreeData: vscode.EventEmitter<OpenApiTreeNode | undefined | null | void> = new vscode.EventEmitter<OpenApiTreeNode | undefined | null | void>();
readonly onDidChangeTreeData: vscode.Event<OpenApiTreeNode | undefined | null | void> = this._onDidChangeTreeData.event;
private apiTitle?: string;
public apiTitle?: string;
private initialStateHash: string = '';
constructor(
private readonly context: vscode.ExtensionContext,
Expand Down

0 comments on commit bc68b4f

Please sign in to comment.