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

Use serde-derive-internals to process related serde attributes #65

Open
snowsignal opened this issue Feb 14, 2023 · 1 comment
Open
Labels
improvement Improvement to an already-existing feature.

Comments

@snowsignal
Copy link
Contributor

Right now we are using hacky workarounds to resolve serde attributes on typeshared types - ideally, we should be utilizing serde's internal attribute parser instead.

@snowsignal snowsignal added the improvement Improvement to an already-existing feature. label Feb 14, 2023
@czocher
Copy link
Contributor

czocher commented Jun 20, 2023

@inquisitivepenguin I had a first look at this and it would probably also require #120 to be done either beforehand or together with this task. In my opinion #120 should also be included in the same milestone.

Additionally, moving to syn2 seems like a big endeavor:

  • Since the serde-derive-internals parser seems to be consuming the input, we'd need to perform two parsing passes. One performed by serde-derive-internals, one performed by our own parser.
  • We should mimic a similar structure that serde-derive-internals has i.e. a Container struct maybe implementing the Parse trait, which would parse a given struct or enum and provide accessors to all the required #[typeshare(...)] annotations, both on the whole Container as well as the fields or variants.

After both passes - by serde-derive-internals and our own parser - we'd need to merge both results into a single one based on the struct/enum/field idents.

At this moment I don't see any way to perform this operation in steps. This means that the parser should probably be rewritten from scratch in one go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement to an already-existing feature.
Projects
None yet
Development

No branches or pull requests

2 participants