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

Comments from .proto files should move over to dart #161

Closed
ened opened this issue Oct 5, 2018 · 12 comments · Fixed by #860
Closed

Comments from .proto files should move over to dart #161

ened opened this issue Oct 5, 2018 · 12 comments · Fixed by #860
Assignees

Comments

@ened
Copy link

ened commented Oct 5, 2018

Given this enum defined in a proto file:

// Defines the response status for a IAP operation.
enum IAPResponseStatus {
    // All went well, see the other fields for response details.
    ok = 0;

    // Fatal error during the API action.
    error = 1;

    // (iOS only) Library user needs to fetch the list of products from the store first.
    emptyProductList = 2;

    // In-App purchases not available (device or policy constraints etc).
    disabled = 3;
}

Then this plugin currently generates:

class IAPResponseStatus extends $pb.ProtobufEnum {
  static const IAPResponseStatus ok = const IAPResponseStatus._(0, 'ok');
  static const IAPResponseStatus error = const IAPResponseStatus._(1, 'error');
  static const IAPResponseStatus emptyProductList = const IAPResponseStatus._(2, 'emptyProductList');
  static const IAPResponseStatus disabled = const IAPResponseStatus._(3, 'disabled');
}

However, it should generate:

/// Defines the response status for a IAP operation.
class IAPResponseStatus extends $pb.ProtobufEnum {
  /// All went well, see the other fields for response details.
  static const IAPResponseStatus ok = const IAPResponseStatus._(0, 'ok');
  /// Fatal error during the API action.
  static const IAPResponseStatus error = const IAPResponseStatus._(1, 'error');
  /// (iOS only) Library user needs to fetch the list of products from the store first.
  static const IAPResponseStatus emptyProductList = const IAPResponseStatus._(2, 'emptyProductList');
  /// In-App purchases not available (device or policy constraints etc).
  static const IAPResponseStatus disabled = const IAPResponseStatus._(3, 'disabled');
}
@sigurdm sigurdm self-assigned this Oct 31, 2018
@sigurdm
Copy link
Collaborator

sigurdm commented Oct 31, 2018

I think this should be true of all comments.
I will look into this

@mit-mit mit-mit transferred this issue from dart-archive/dart-protoc-plugin Dec 14, 2018
@sigurdm sigurdm removed their assignment Jun 25, 2019
@sigurdm sigurdm changed the title enum value comments should move over to dart Comments from .proto files should move over to dart Jun 25, 2019
@v0l
Copy link

v0l commented Jul 24, 2019

With gRPC this would be very helpful to copy all the comments from rpc methods into the dart code!

@armiol
Copy link

armiol commented May 22, 2020

Is this still considered for implementation? We are struggling with the comments not being transferred to the Dart output as well.

@sigurdm
Copy link
Collaborator

sigurdm commented May 26, 2020

It would be awesome to support I agree. Currently we don't have a lot of resources, so don't expect it to happen soon.

@MattyBoy4444
Copy link

Any news on this?

@bartekpacia
Copy link

bartekpacia commented Feb 20, 2023

This would be a very useful feature.

I'll offer a use case I have: I generate the Selector class from the .proto file, and it's part of my package's public API. Unfortunately, I cannot add doc comments to it, because well... it's generated. Result: users of my package don't have docs when they hover over the Selector in their IDE.

Tagging @sigurdm – I've seen you're activate on Dart related repos on dart-lang and google. I hope you can find some resources to implement this 🙏🏻

@sigurdm
Copy link
Collaborator

sigurdm commented Feb 20, 2023

Unfortunately I no longer work on the dart-protobuf project.

I did start looking into this long time ago, and all the information is there in the descriptors, but there are quite some details in converting them to useful dartdoc comments - and also questions about how it should be configured. I never got very far.

I still think it would be really nice to have though.

@bartekpacia
Copy link

Sure, I understand.

If Google can't do this because it's not an important issue for you... is this repository accepting contributions?

@sigurdm
Copy link
Collaborator

sigurdm commented Feb 20, 2023

I will defer to @osa1 who is working in this now.

@kevmoo
Copy link
Collaborator

kevmoo commented Jul 7, 2023

I'd LOVE to have this, too.

@kevmoo kevmoo self-assigned this Jul 9, 2023
kevmoo added a commit that referenced this issue Jul 12, 2023
Fixes #161

---------

Co-authored-by: Ömer Sinan Ağacan <omersa@google.com>
@bartekpacia
Copy link

bartekpacia commented Jul 13, 2023

Wow, awesome! Thanks @kevmoo!

@kevmoo
Copy link
Collaborator

kevmoo commented Jul 13, 2023

Wow, awesome! Thanks @kevmoo!

There is some more work we could do here. Like making the comment references to other types work. Let's file separate issues for those.

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

Successfully merging a pull request may close this issue.

8 participants