Skip to content

Commit

Permalink
feat: adds dart generation to extension
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed Jan 14, 2025
1 parent 99d9038 commit f3730e6
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 2 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

## [1.22.100000001] - 2025-01-10
Expand Down
21 changes: 20 additions & 1 deletion 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 @@ -547,4 +566,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 f3730e6

Please sign in to comment.