-
Notifications
You must be signed in to change notification settings - Fork 213
Macros: Will it be possible to Introspect Doc Comments in declaration phase? #3611
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
Comments
I'd assume this is just an oversight. Not having access to default values sounds like a major flaw. They are definitely a requirement, as they are often copy-pasted from one place to another. |
#3305 is where discussion around default values has been had so far. Ultimately, I would love to have a language level feature to handle this case. In general, it is not always even possible to duplicate a default value, since it could be private. So, some language feature to just refer to the original default would be better, as it could get around that issue. |
In my particular use case, I think getting access to the
Thanks! I left a comment in there, and consider the default value portion of this issue as a duplicate. I also changed this issue to hone in on the doc comments portion (unless you'd like a new issue?). |
Moving this conversation here, from a request I had made in the dart analyzer discussion group.
TLDR: are doc comments planned to be supported by the macro introspection APIs?
I've been playing around with the latest macro implementation for the past two weeks or so, to experiment with the new APIs and get a feel for the differences from the analyzer APIs.
I've been building two code-gen related packages with macros in mind (hoping macros could make the UX of the package even better eventually). One of those packages is a cli command/args generator, that can create an ArgParser instance based on the parameters of a function or constructor, like so:
However, I don't see Doc Comments on any of the introspection APIs, - this is despite those elements
technicallybeing static at compile time (I'm sure"static" was never meant to apply to comments, but I think the intent of the question still stands).FWIW, this is the existing analyzer API that exposes doc comments:
The text was updated successfully, but these errors were encountered: