You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my attempt to develop a macro which injects documentation into indicated classes and fields, I have not found a means that the former is currently possible.
I tried the obvious, assigning directly inside a build macro:
This does not function as I would hope (it works great for fields though). The assignment has no effect since I am modifying the response from Ref.get(), not the class itself.
When using an initialization macro, onAfterGenerate and onAfterInitMacros have no access to the classes, while onGenerate and onAfterTyping only provide Refs to the classes. MetadataAccess is provided to inject metadata at this stage, and build macros can be used to modify fields of those types completely, but I have found no means to inject documentation onto the class itself.
Either a dedicated means of injecting class documentation, a built-in compiler metadata which takes documentation to apply as an argument, or a workaround to this issue that I"m overlooking, any of these would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
I"m guessing you want this as a solution to #11375, but running a build macro on everything for this purpose seems really slow and impractical. But at the very least we should make it clear in the documentation that modifying these values has no effect on the internal class instance.
An alternative could be some metadata like @:doc("Hello, world!") which concatenates metadata to the field, and otherwise acts like @:inheritDoc. That would allow applying documentation via build macro as well, unless the mechanism behind @:inheritDoc is also impractical.
In my attempt to develop a macro which injects documentation into indicated classes and fields, I have not found a means that the former is currently possible.
I tried the obvious, assigning directly inside a build macro:
This does not function as I would hope (it works great for fields though). The assignment has no effect since I am modifying the response from
Ref.get()
, not the class itself.When using an initialization macro,
onAfterGenerate
andonAfterInitMacros
have no access to the classes, whileonGenerate
andonAfterTyping
only provideRef
s to the classes. MetadataAccess is provided to inject metadata at this stage, and build macros can be used to modify fields of those types completely, but I have found no means to inject documentation onto the class itself.Either a dedicated means of injecting class documentation, a built-in compiler metadata which takes documentation to apply as an argument, or a workaround to this issue that I"m overlooking, any of these would be greatly appreciated.
The text was updated successfully, but these errors were encountered: