typeshare
typeshare copied to clipboard
Support for types generated by macros
Does typeshare support types generated by a macro? Is it something that could be implemented without too much effort? #49 seems to be related.
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.
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.
Just spitballing here, could cargo-expand help at all? Either in downstream toolchains or called from typeshare.
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.
+1, would really like this too.