-
Notifications
You must be signed in to change notification settings - Fork 0
Add C++ GetArrayDataTypeUseCase #46
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces C++ array data type handling by adding a new GetArrayDataTypeUseCase class and updating related components. The changes implement C++ std::vector type mappings for various primitive and custom data types.
Key changes:
- Added
GetArrayDataTypeUseCaseclass to handle C++ array type mappings - Updated
GetTypeNameUseCaseto use the new array data type handler - Removed incorrect Kotlin import from
PrepareRightValueUseCase
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| GetArrayDataTypeUseCase.kt | New class implementing C++ array type mappings using std::vector |
| GetArrayDataTypeUseCaseTest.kt | Comprehensive test coverage for the new array data type use case |
| GetTypeNameUseCase.kt | New type name resolution class utilizing the array data type handler |
| PrepareRightValueUseCaseTest.kt | Test class for right value preparation functionality |
| PrepareRightValueUseCase.kt | Removed incorrect Kotlin import reference |
| CppEnumGeneratorTest.kt | Updated test with additional dependencies and test cases |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| is DataType.custom -> type.block.name | ||
| is DataType.userClassTest2 -> type.node.getPath() | ||
| else -> "ktQQTP_$type" | ||
| } + (if (type.canBeNull) "?" else "") |
Copilot
AI
Oct 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nullable syntax ? is Kotlin-specific and not valid for C++. C++ uses pointers or optional types for nullable values.
| } + (if (type.canBeNull) "?" else "") | |
| }.let { typeName -> if (type.canBeNull) "std::optional<$typeName>" else typeName } |
| """.trimIndent()) as Namespace | ||
| val block = tree.subs.first() as ConstantsEnum | ||
|
|
||
| val projectOutput = OutputTree(Target.Kotlin) |
Copilot
AI
Oct 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target should be Target.Cpp since this is testing C++ enum generation, not Kotlin.
| val projectOutput = OutputTree(Target.Kotlin) | |
| val projectOutput = OutputTree(Target.Cpp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| DataType.uint64 -> "std::vector<uint64_t>" | ||
| DataType.float32 -> "std::vector<float>" | ||
| DataType.float64 -> "std::vector<double>" | ||
| is DataType.string -> "std::vector<std::string>" |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pattern matching on DataType.string should not use is keyword since string is likely a companion object property, not a class. Use DataType.string without is.
| is DataType.string -> "std::vector<std::string>" | |
| DataType.string -> "std::vector<std::string>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
No description provided.