Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VsCode] Renames name_to_be_defined plugin type to apiplugin #4787

Merged
merged 5 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions vscode/microsoft-kiota/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export async function activate(
}
}
async function generatePluginAndRefreshUI(config: Partial<GenerateState>, settings: ExtensionSettings, outputPath: string, selectedPaths: string[]):Promise<void> {
const pluginTypes = typeof config.pluginTypes === 'string' ? parsePluginType(config.pluginTypes) : KiotaPluginType.Microsoft;
const pluginTypes = typeof config.pluginTypes === 'string' ? parsePluginType(config.pluginTypes) : KiotaPluginType.ApiPlugin;
const result = await vscode.window.withProgress({
location: vscode.ProgressLocation.Notification,
cancellable: false,
Expand Down Expand Up @@ -446,7 +446,7 @@ export async function activate(
void vscode.window.showInformationMessage(`Client ${clientKey} re-generated successfully.`);
}
async function regeneratePlugin(clientKey: string, clientObject:any, settings: ExtensionSettings, selectedPaths?: string[]) {
const pluginTypes = typeof clientObject.pluginTypes === 'string' ? parsePluginType(clientObject.pluginTypes) : KiotaPluginType.Microsoft;
const pluginTypes = typeof clientObject.pluginTypes === 'string' ? parsePluginType(clientObject.pluginTypes) : KiotaPluginType.ApiPlugin;
await vscode.window.withProgress({
location: vscode.ProgressLocation.Notification,
cancellable: false,
Expand Down
6 changes: 3 additions & 3 deletions vscode/microsoft-kiota/src/kiotaInterop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export enum KiotaPluginType {
// eslint-disable-next-line @typescript-eslint/naming-convention
ApiManifest = 1,
// eslint-disable-next-line @typescript-eslint/naming-convention
Microsoft = 2,
ApiPlugin = 2,
}

export enum ConsumerOperation {
Expand All @@ -130,8 +130,8 @@ export function parsePluginType(value: string): KiotaPluginType {
return KiotaPluginType.OpenAI;
case "ApiManifest":
return KiotaPluginType.ApiManifest;
case "Microsoft":
return KiotaPluginType.Microsoft;
case "ApiPlugin":
return KiotaPluginType.ApiPlugin;
default:
throw new Error("unknown plugin type");
}
Expand Down
4 changes: 2 additions & 2 deletions vscode/microsoft-kiota/src/steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export async function generateSteps(existingConfiguration: Partial<GenerateState
return (input: MultiStepInput) => inputPluginType(input, state);
}
async function inputPluginType(input: MultiStepInput, state: Partial<GenerateState>) {
const items = ['Microsoft','Open AI'].map(x => ({ label: x})as QuickPickItem);
const items = ['ApiPlugin','Open AI'].map(x => ({ label: x})as QuickPickItem);
const pluginTypes = await input.showQuickPick({
title: l10n.t('Choose a plugin type'),
step: step++,
Expand All @@ -246,7 +246,7 @@ export async function generateSteps(existingConfiguration: Partial<GenerateState
validate: validateIsNotEmpty,
shouldResume: shouldResume
});
pluginTypes.label === 'Microsoft'? state.pluginTypes = 'Microsoft' : state.pluginTypes = 'OpenAI';
pluginTypes.label === 'ApiPlugin' ? state.pluginTypes = 'ApiPlugin' : state.pluginTypes = 'OpenAI';
return (input: MultiStepInput) => inputPluginOutputPath(input, state);
}
async function inputPluginOutputPath(input: MultiStepInput, state: Partial<GenerateState>) {
Expand Down
Loading