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

Support for generating Comment #365

Closed
EpicKim opened this issue Apr 14, 2020 · 4 comments
Closed

Support for generating Comment #365

EpicKim opened this issue Apr 14, 2020 · 4 comments

Comments

@EpicKim
Copy link

EpicKim commented Apr 14, 2020

i have a test file like this:

syntax = "proto2";

message Test {
  // tag
  required string label = 1;
  required int64 reps = 3; // reps
}

run protoc --dart_out=./output test.proto to generate code.

And i found that in generated file property don't have comment.

As in below

///
//  Generated code. Do not modify.
//  source: test.proto
//
// @dart = 2.3
// ignore_for_file: camel_case_types,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type

import 'dart:core' as $core;

import 'package:fixnum/fixnum.dart' as $fixnum;
import 'package:protobuf/protobuf.dart' as $pb;

class Test extends $pb.GeneratedMessage {
  static final $pb.BuilderInfo _i = $pb.BuilderInfo('Test', createEmptyInstance: create)
    ..aQS(1, 'label')
    ..a<$fixnum.Int64>(3, 'reps', $pb.PbFieldType.Q6, defaultOrMaker: $fixnum.Int64.ZERO)
  ;

  Test._() : super();
  factory Test() => create();
  factory Test.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
  factory Test.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
  Test clone() => Test()..mergeFromMessage(this);
  Test copyWith(void Function(Test) updates) => super.copyWith((message) => updates(message as Test));
  $pb.BuilderInfo get info_ => _i;
  @$core.pragma('dart2js:noInline')
  static Test create() => Test._();
  Test createEmptyInstance() => create();
  static $pb.PbList<Test> createRepeated() => $pb.PbList<Test>();
  @$core.pragma('dart2js:noInline')
  static Test getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Test>(create);
  static Test _defaultInstance;

  @$pb.TagNumber(1)
  $core.String get label => $_getSZ(0);
  @$pb.TagNumber(1)
  set label($core.String v) { $_setString(0, v); }
  @$pb.TagNumber(1)
  $core.bool hasLabel() => $_has(0);
  @$pb.TagNumber(1)
  void clearLabel() => clearField(1);

  @$pb.TagNumber(3)
  $fixnum.Int64 get reps => $_getI64(1);
  @$pb.TagNumber(3)
  set reps($fixnum.Int64 v) { $_setInt64(1, v); }
  @$pb.TagNumber(3)
  $core.bool hasReps() => $_has(1);
  @$pb.TagNumber(3)
  void clearReps() => clearField(3);
}
@Jonas-Sander
Copy link

I tried to generate googleapis but it is really unmanagable to use if there are no comments.

@zsmatrix62
Copy link

it is appreciated to have this feature so that we can get rid of to check comments in proto files ..

pls keep updated the progress, thanks.

@MattyBoy4444
Copy link

Please add this feature. c# has had this for a while.

@osa1
Copy link
Member

osa1 commented Apr 14, 2022

Duplicate of #161.

@osa1 osa1 closed this as completed Apr 14, 2022
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

No branches or pull requests

5 participants