protoc-gen-ts icon indicating copy to clipboard operation
protoc-gen-ts copied to clipboard

Solo enum in the proto file case a bad field type name

Open CorrM opened this issue 1 year ago • 3 comments

When i have one enum(maybe more than one too) on the whole file that will case a bad filed type name.

After checking src i think the bug would be in that function field.getType

Sorry im so busy this days, i can't submit PR

Bug showcase:

// update-prop-message.ts
// enumUpdatePropChangeEnum MUST to be UpdatePropChangeEnum
set change_type(value: dependency_1.enumUpdatePropChangeEnum) {
        pb_1.Message.setField(this, 1, value);
}

Files to raise the bug:

// update-prop-change-enum.proto
syntax = "proto3";

package MY_PACKAGE.enum;

enum UpdatePropChangeEnum
{
  UpdatePropChange_NONE = 0;
  CHANGE = 1;
}
// update-prop-message.proto
syntax = "proto3";

package MY_PACKAGE.message;

import "update-prop-change-enum.proto";

message UpdatePropMessage
{
  MY_PACKAGE.enum.UpdatePropChangeEnum change_type = 1;
}

CorrM avatar Nov 13 '22 07:11 CorrM