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

Write @deprecated jsdoc annotation if includeComments is enabled #2357

Merged
merged 2 commits into from
Feb 13, 2023

Conversation

danielronnkvist
Copy link
Contributor

By adding the JSDoc @deprecated annotation to the output comments to interface fields IDE's can pick it up and deliver a better developer experience. This annotation is only added when the includeComments option is enabled. Since protobuf.js already parses if a field is deprecated or not the options object with that information is passed to the formatComment function.

Update golden generated with @deprecated annotation.

Resolves #2348

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 10, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: danielronnkvist / name: Daniel Rönnkvist (c20ddd3)

@@ -184,7 +189,7 @@ const typeBrandHint = `This field is a type brand and is not populated at runtim
https://github.com/grpc/grpc-node/pull/2281`;

function formatTypeBrand(formatter: TextFormatter, messageType: Protobuf.Type) {
formatComment(formatter, typeBrandHint);
formatComment(formatter, typeBrandHint, messageType.options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this one is right. This comment isn't on the message interface itself, but rather on a synthetic field in the interface. So it doesn't make sense for this field to inherit the message type's deprecated status.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@murgatroid99 I removed the options argument for this format call.

Copy link
Member

@murgatroid99 murgatroid99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution.

@murgatroid99 murgatroid99 merged commit e967c94 into grpc:master Feb 13, 2023
@murgatroid99
Copy link
Member

This is out in version 0.7.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add JSDoc comment to mark fields as deprecated in output interfaces
3 participants