Skip to content

Commit

Permalink
Merge pull request #6007 from microsoft/fix/missing-dart-extension
Browse files Browse the repository at this point in the history
feat: adds dart generation to extension
  • Loading branch information
baywet authored Jan 14, 2025
2 parents 11cd214 + 2826567 commit 56b335c
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 6 deletions.
2 changes: 2 additions & 0 deletions vscode/microsoft-kiota/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

- Fixed a bug in the VS Code extension deeplink with the API Center extension [#6004](https://github.com/microsoft/kiota/issues/6004)
Expand Down
35 changes: 30 additions & 5 deletions vscode/microsoft-kiota/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -125,31 +144,37 @@
"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%"
},
"kiota.generate.deserializer.PHP": {
"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%"
},
"kiota.generate.serializer.Python": {
"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%"
},
"kiota.generate.deserializer.Python": {
"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%"
},
Expand Down Expand Up @@ -547,4 +572,4 @@
"sha256": "2525D4A8C3ED4972C05E57E4DB2D244E1A708325CE4A5CFB24822D9FD7BB7ED3"
}
]
}
}
3 changes: 3 additions & 0 deletions vscode/microsoft-kiota/src/kiotaInterop/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand All @@ -137,6 +139,7 @@ export const allGenerationLanguages = [
KiotaGenerationLanguage.CLI,
KiotaGenerationLanguage.Swift,
KiotaGenerationLanguage.TypeScript,
KiotaGenerationLanguage.Dart,
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: [] }
},
};

Expand Down
2 changes: 2 additions & 0 deletions vscode/microsoft-kiota/src/types/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions vscode/microsoft-kiota/src/types/extensionSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
};
}
Expand Down
2 changes: 2 additions & 0 deletions vscode/microsoft-kiota/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 56b335c

Please sign in to comment.