Skip to content

Class implementation #19

Closed
Closed

Description

@itzaks

Hi!

Great macro. Any chance to make it work for classes?

Activity

  1. soumyamahunt commented on Sep 14, 2023

    @soumyamahunt
    Contributor

    Thanks @itzaks.

    The major challenge of making it work with classes is knowing whether the super class conforms to Codable already or not. Currently there is no way for macros to know that, however after this pitch implemented and available it will be possible to do so.

  2. itzaks commented on Sep 16, 2023

    @itzaks
    Author

    I see, thanks! 🙂

  3. MartinLau7 commented on Dec 13, 2023

    @MartinLau7

    I noticed that this pitch was already implemented in 5.9.2

  4. soumyamahunt commented on Dec 14, 2023

    @soumyamahunt
    Contributor

    I noticed that this pitch was already implemented in 5.9.2

    Thanks for noticing this, didn't think they will add this feature to the new fix release. Now classes can be supported with some change.

  5. soumyamahunt commented on Dec 18, 2023

    @soumyamahunt
    Contributor

    @MartinLau7 swift-syntax hasn't released the update in protocol requirement, it is present in main branch but hasn't been released yet.

    This needs to be released as well for MetaCodable to support this feature.

  6. MartinLau7 commented on Dec 19, 2023

    @MartinLau7

    @soumyamahunt Thank you for your reply. I can assist with testing once a new version is released.

  7. soumyamahunt commented on Dec 19, 2023

    @soumyamahunt
    Contributor

    Thanks @MartinLau7, the changes are ready in #48, branch class-support. You can comment out following lines in Package.swift to use a custom swift-syntax branch that has the required changes:

    if Context.environment["SWIFT_SYNTAX_EXTENSION_MACRO_FIXED"] != nil {

    Let me know if you face any issues.

  8. MartinLau7 commented on Dec 26, 2023

    @MartinLau7

    @soumyamahunt
    I apologize for not being able to respond in time earlier. I was ill and had to take some time off.
    I ran the tests locally as you instructed. Are the tests in the class-support branch currently available? When I run the unit tests, the Class section fails.

    image
  9. soumyamahunt commented on Dec 26, 2023

    @soumyamahunt
    Contributor

    @soumyamahunt I apologize for not being able to respond in time earlier. I was ill and had to take some time off.

    No issues, hope you are feeling better now.

    I ran the tests locally as you instructed. Are the tests in the class-support branch currently available? When I run the unit tests, the Class section fails.

    I meant playing with the feature as in writing some class models using the library. Unit test support for this macro feature hasn't been added in swift-syntax as well. Also, you don't need to run tests manually, CI takes care of that.

  10. MartinLau7 commented on Dec 27, 2023

    @MartinLau7

    Thank you for your explanation. I have already tried the demo locally and it is working fine. Thank you for your help.

  11. soumyamahunt commented on Jan 9, 2024

    @soumyamahunt
    Contributor

    @itzaks @MartinLau7 class support has been released:

  12. itzaks commented on Jan 16, 2024

    @itzaks
    Author

    Amazing. Thanks for all your work! Looking forward to test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions