-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
Describe the bug
Since protoc version 3.15, it enabled the use of optional in proto3 by default. See field_presence. But this plugin still reports errors when using optional.
To Reproduce
Steps to reproduce the behavior:
syntax = "proto3";
message Msg {
optional int32 foo = 1;
}
Expected behavior
No error, no warning.
Plugin (please complete the following information):
- Plugin version: 0.12.0
Additional context
The check action may be as follows:
private void checkFieldLabelProto3(FieldNode field) {
Optional<FieldLabel> fieldLabel = field.getFieldLabel();
fieldLabel.ifPresent(label -> {
if (label == FieldLabel.OPTIONAL
|| label == FieldLabel.REQUIRED) {
String message = message("error.illegal.field.label", label.getName());
markError(field.getFieldLabelNode(), null, message);
}
});
}
davidmankin and phemmer
Metadata
Metadata
Assignees
Labels
No labels
