Skip to content
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

tsync from other proc-macros? #8

Closed
RossRogers opened this issue Nov 17, 2022 · 3 comments
Closed

tsync from other proc-macros? #8

RossRogers opened this issue Nov 17, 2022 · 3 comments

Comments

@RossRogers
Copy link
Contributor

If a proc-macro generates a struct, those generated structs are not exported, even if the #[tsync] annotation is on the generated struct. Is this possible to somehow accomplish with tsync's current architecture?

@Wulf
Copy link
Owner

Wulf commented Nov 19, 2022

No, not with the current architecture. Maybe in the future though :)

@AravindPrabhs
Copy link
Contributor

AravindPrabhs commented Nov 30, 2022

I also ran into this. I was able to cobble a hacky solution:

  • change the tsync-macro to add a comment "tsync managed"
  • use cargo expand to expand the file in question (doing the whole crate gets massive with all web/serialization attributes) and run tsync on that
    • effectively just compose the cargo expand and tsync cli calls.
  • edit has_tsync_attribute to also check for the doc comments so those constructs are also considered.

The "search" for "tsync" attributes has to be changed to be changed to recursed on modules and in my case impls as well.

The initial working solution: "https://github.com/AravindPrabhs/tsync/tree/amenable_to_cargo_expand"

@Wulf
Copy link
Owner

Wulf commented Aug 7, 2023

Closing this; feel free to re-open!

@Wulf Wulf closed this as completed Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants