-
Notifications
You must be signed in to change notification settings - Fork 5
Improves Swift available attribute generation based on OTel deprecation metadata
#19
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
Improves Swift available attribute generation based on OTel deprecation metadata
#19
Conversation
This decodes the different OTel deprecation type options, and renders different Swift deprecation attributes based on that type
This adjusts the rename_to deprecation logic to correctly resolve Swift member names, while allowing different rendering type hierarchies, and namespace/property naming strategies. It does so by introducing an `attributeIdToSwiftMemberPath` requirement on the FileRenderer protocol, and using that protocol in the deprecation logic. Since this function typically requires walking the full namespace tree, a Context type was added to inject the namespace tree into the renderers for reference. Finally, the deprecation tests now require a fake namespace tree for renamed deprecation type resolution. There were no changes to the current generated code-set resulting from these adjustments.
79a8b7e to
0dd164c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work Jay! I can see this leading to a really nice deprecation UX once we generate some renamed attributes too 🥳 And the way you implemented it should enable us to do the improved DocC references too 🙏
Thanks! Yeah, it'll be cool to have it be really smooth and usable. Thanks for the review! |
This decodes the different OTel deprecation type options, and renders different Swift
@availableattributes based on that type. Specifically,renamedattributes get arenamedargument in the Swift attribute, andobsoletedget a prefix to theirmessage. Non-labeled OTel deprecations are interpreted asuncategorized, which are translated to an ordinary Swift deprecation without arenamedsection ormessageprefix.It introduces tests to the Generator package, covering these particular decoding and generation paths.
This resolves #15