From f3730e68b34420835ebe8f5290262f50ef7da238 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 14 Jan 2025 10:30:07 -0500 Subject: [PATCH 1/2] feat: adds dart generation to extension --- vscode/microsoft-kiota/CHANGELOG.md | 2 ++ vscode/microsoft-kiota/package.json | 21 ++++++++++++++++++- .../microsoft-kiota/src/kiotaInterop/index.ts | 3 +++ .../commands/generateClientCommand.test.ts | 3 ++- vscode/microsoft-kiota/src/types/enums.ts | 2 ++ .../src/types/extensionSettings.ts | 1 + vscode/microsoft-kiota/src/util.ts | 2 ++ 7 files changed, 32 insertions(+), 2 deletions(-) diff --git a/vscode/microsoft-kiota/CHANGELOG.md b/vscode/microsoft-kiota/CHANGELOG.md index e1a6bf8573..59ef66bfb3 100644 --- a/vscode/microsoft-kiota/CHANGELOG.md +++ b/vscode/microsoft-kiota/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file. ### Added +- Added dart generation to Visual Studio Code extension. + ### Changed ## [1.22.100000001] - 2025-01-10 diff --git a/vscode/microsoft-kiota/package.json b/vscode/microsoft-kiota/package.json index 2478c6889e..1465383b4a 100644 --- a/vscode/microsoft-kiota/package.json +++ b/vscode/microsoft-kiota/package.json @@ -83,6 +83,25 @@ ], "description": "%kiota.generate.deserializer.description%" }, + "kiota.generate.serializer.Dart": { + "type": "array", + "default": [ + "microsoft_kiota_serialization_json/microsoft_kiota_serialization_json.JsonSerializationWriterFactory", + "microsoft_kiota_serialization_form/microsoft_kiota_serialization_form.FormSerializationWriterFactory", + "microsoft_kiota_serialization_text/microsoft_kiota_serialization_text.TextSerializationWriterFactory", + "microsoft_kiota_serialization_multipart/microsoft_kiota_serialization_multipart.MultipartSerializationWriterFactory" + ], + "description": "%kiota.generate.serializer.description%" + }, + "kiota.generate.deserializer.Dart": { + "type": "array", + "default": [ + "microsoft_kiota_serialization_json/microsoft_kiota_serialization_json.JsonParseNodeFactory", + "microsoft_kiota_serialization_text/microsoft_kiota_serialization_text.TextParseNodeFactory", + "microsoft_kiota_serialization_form/microsoft_kiota_serialization_form.FormParseNodeFactory" + ], + "description": "%kiota.generate.deserializer.description%" + }, "kiota.generate.serializer.Go": { "type": "array", "default": [ @@ -547,4 +566,4 @@ "sha256": "2525D4A8C3ED4972C05E57E4DB2D244E1A708325CE4A5CFB24822D9FD7BB7ED3" } ] -} \ No newline at end of file +} diff --git a/vscode/microsoft-kiota/src/kiotaInterop/index.ts b/vscode/microsoft-kiota/src/kiotaInterop/index.ts index 490780d03b..e09cf84a9e 100644 --- a/vscode/microsoft-kiota/src/kiotaInterop/index.ts +++ b/vscode/microsoft-kiota/src/kiotaInterop/index.ts @@ -122,6 +122,8 @@ export function generationLanguageToString(language: KiotaGenerationLanguage): s return "Ruby"; case KiotaGenerationLanguage.CLI: return "CLI"; + case KiotaGenerationLanguage.Dart: + return "Dart"; default: throw new Error("unknown language"); } @@ -137,6 +139,7 @@ export const allGenerationLanguages = [ KiotaGenerationLanguage.CLI, KiotaGenerationLanguage.Swift, KiotaGenerationLanguage.TypeScript, + KiotaGenerationLanguage.Dart, ]; /** diff --git a/vscode/microsoft-kiota/src/test/suite/commands/generateClientCommand.test.ts b/vscode/microsoft-kiota/src/test/suite/commands/generateClientCommand.test.ts index 5f7b4de9ee..8537b10b07 100644 --- a/vscode/microsoft-kiota/src/test/suite/commands/generateClientCommand.test.ts +++ b/vscode/microsoft-kiota/src/test/suite/commands/generateClientCommand.test.ts @@ -65,7 +65,8 @@ let extensionSettings = { [KiotaGenerationLanguage.Python]: { serializers: [], deserializers: [] }, [KiotaGenerationLanguage.Ruby]: { serializers: [], deserializers: [] }, [KiotaGenerationLanguage.Swift]: { serializers: [], deserializers: [] }, - [KiotaGenerationLanguage.TypeScript]: { serializers: [], deserializers: [] } + [KiotaGenerationLanguage.TypeScript]: { serializers: [], deserializers: [] }, + [KiotaGenerationLanguage.Dart]: { serializers: [], deserializers: [] } }, }; diff --git a/vscode/microsoft-kiota/src/types/enums.ts b/vscode/microsoft-kiota/src/types/enums.ts index e3340f0b2c..e4859d4acb 100644 --- a/vscode/microsoft-kiota/src/types/enums.ts +++ b/vscode/microsoft-kiota/src/types/enums.ts @@ -26,6 +26,8 @@ export enum KiotaGenerationLanguage { Ruby = 7, // eslint-disable-next-line @typescript-eslint/naming-convention CLI = 8, + // eslint-disable-next-line @typescript-eslint/naming-convention + Dart = 9, }; export enum KiotaPluginType { diff --git a/vscode/microsoft-kiota/src/types/extensionSettings.ts b/vscode/microsoft-kiota/src/types/extensionSettings.ts index 172d8106cb..fe5ccfb0d3 100644 --- a/vscode/microsoft-kiota/src/types/extensionSettings.ts +++ b/vscode/microsoft-kiota/src/types/extensionSettings.ts @@ -20,6 +20,7 @@ export function getExtensionSettings(extensionId: string): ExtensionSettings { [KiotaGenerationLanguage.Ruby]: getLanguageSerializationConfiguration(extensionId, "Ruby"), [KiotaGenerationLanguage.Swift]: getLanguageSerializationConfiguration(extensionId, "Swift"), [KiotaGenerationLanguage.TypeScript]: getLanguageSerializationConfiguration(extensionId, "TypeScript"), + [KiotaGenerationLanguage.Dart]: getLanguageSerializationConfiguration(extensionId, "Dart"), }, }; } diff --git a/vscode/microsoft-kiota/src/util.ts b/vscode/microsoft-kiota/src/util.ts index b07930e64d..ab6146f49e 100644 --- a/vscode/microsoft-kiota/src/util.ts +++ b/vscode/microsoft-kiota/src/util.ts @@ -138,6 +138,8 @@ export function parseGenerationLanguage(value: string): KiotaGenerationLanguage return KiotaGenerationLanguage.Ruby; case "cli": return KiotaGenerationLanguage.CLI; + case "dart": + return KiotaGenerationLanguage.Dart; default: throw new Error("unknown language " + value); } From 0087c12e0e184ec74acf55509e36708444b4c7e7 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 14 Jan 2025 10:33:02 -0500 Subject: [PATCH 2/2] fix: adds missing serialization values for php and python in extension --- vscode/microsoft-kiota/package.json | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/vscode/microsoft-kiota/package.json b/vscode/microsoft-kiota/package.json index 1465383b4a..ad06b5cb2f 100644 --- a/vscode/microsoft-kiota/package.json +++ b/vscode/microsoft-kiota/package.json @@ -144,7 +144,9 @@ "type": "array", "default": [ "Microsoft\\Kiota\\Serialization\\Json\\JsonSerializationWriterFactory", - "Microsoft\\Kiota\\Serialization\\Text\\TextSerializationWriterFactory" + "Microsoft\\Kiota\\Serialization\\Text\\TextSerializationWriterFactory", + "Microsoft\\Kiota\\Serialization\\Form\\FormSerializationWriterFactory", + "Microsoft\\Kiota\\Serialization\\Multipart\\MultipartSerializationWriterFactory" ], "description": "%kiota.generate.serializer.description%" }, @@ -152,7 +154,8 @@ "type": "array", "default": [ "Microsoft\\Kiota\\Serialization\\Json\\JsonParseNodeFactory", - "Microsoft\\Kiota\\Serialization\\Text\\TextParseNodeFactory" + "Microsoft\\Kiota\\Serialization\\Text\\TextParseNodeFactory", + "Microsoft\\Kiota\\Serialization\\Form\\FormParseNodeFactory" ], "description": "%kiota.generate.deserializer.description%" }, @@ -160,7 +163,9 @@ "type": "array", "default": [ "kiota_serialization_json.json_serialization_writer_factory.JsonSerializationWriterFactory", - "kiota_serialization_text.text_serialization_writer_factory.TextSerializationWriterFactory" + "kiota_serialization_text.text_serialization_writer_factory.TextSerializationWriterFactory", + "kiota_serialization_form.form_serialization_writer_factory.FormSerializationWriterFactory", + "kiota_serialization_multipart.multipart_serialization_writer_factory.MultipartSerializationWriterFactory" ], "description": "%kiota.generate.serializer.description%" }, @@ -168,7 +173,8 @@ "type": "array", "default": [ "kiota_serialization_json.json_parse_node_factory.JsonParseNodeFactory", - "kiota_serialization_text.text_parse_node_factory.TextParseNodeFactory" + "kiota_serialization_text.text_parse_node_factory.TextParseNodeFactory", + "kiota_serialization_form.form_parse_node_factory.FormParseNodeFactory" ], "description": "%kiota.generate.deserializer.description%" },