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

Support for types generated by macros #74

Open
axos88 opened this issue Mar 10, 2023 · 5 comments
Open

Support for types generated by macros #74

axos88 opened this issue Mar 10, 2023 · 5 comments
Labels
feature-request A request for a new feature low-priority This issue will not be solved by the Typeshare team, though others are free to work on it

Comments

@axos88
Copy link

axos88 commented Mar 10, 2023

Does typeshare support types generated by a macro? Is it something that could be implemented without too much effort? #49 seems to be related.

@CerulanLumina
Copy link
Collaborator

Currently, Typeshare parses source files as-is, without first expanding macros. This means that types (or any code) generated by a macro will not be considered when exporting types for other languages. Unfortunately, adding this functionality would likely require a significant investment, but it is something we'd like to get to at some point.

@snowsignal snowsignal added the feature-request A request for a new feature label Mar 14, 2023
@Lucretiel
Copy link
Contributor

Status update after today's triage meeting:

Implementing this would require essentially totally rewriting typeshare from scratch, a 2.0 level project. Currently this would be nice-to-have, but we have no plans to implement for the forseeable future.

@CerulanLumina CerulanLumina added the low-priority This issue will not be solved by the Typeshare team, though others are free to work on it label May 3, 2023
@CerulanLumina
Copy link
Collaborator

Just spitballing here, could cargo-expand help at all? Either in downstream toolchains or called from typeshare.

@Lucretiel
Copy link
Contributor

cargo-expand would be one potential way to do it; another (the way I was leaning) would be to use --output-format json with rustdoc to produce machine-readable output from rustdoc, which typeshare would then ingest.

@FrozenDroid
Copy link

+1, would really like this too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A request for a new feature low-priority This issue will not be solved by the Typeshare team, though others are free to work on it
Projects
None yet
Development

No branches or pull requests

5 participants