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
Syntax: option values with arrays are not supported #25
Comments
There is no array in the Maybe you should try to set it again(repeated field): message MyMeta {
int32 id = 1 [(com.util.meta) = {
needValidation: false,
fileMap: {
key: "t",
value: "raw_orders"
},
fileMap: {
key: "key2",
value: "otherValue"
}
}];
} |
There are no many documents for protobuf option, I just use I will add array syntax support in the next version. |
You are right about not much documentation. I was looking for a while to see if this syntax even valid. But I did find it being used in a bunch of places eventually, and I saw that the native IntelliJ plugin does support it well, so I figured it is something that is worth having in your (excellent) plugin too. Thank you! |
I have added array syntax support in commit f211f6d. But I got some problems releasing it, check the issue JetBrains/intellij-platform-gradle-plugin#721 to get more details. There is the local install package, maybe you can help me to test it before the CI work. |
Fixed in release 1.4.1-EAP |
The option syntax is just the protobuf text format. It's not well documented, but syntax = "proto3";
import "google/protobuf/descriptor.proto";
import "google/protobuf/any.proto";
package foo.bar;
message MyType {
repeated google.protobuf.Any any = 1;
bool value = 2;
}
message AnyType1 {
google.protobuf.Any any = 1;
string foo = 2;
}
message AnyType2 {
google.protobuf.Any any = 1;
string bar = 2;
}
extend google.protobuf.FileOptions {
MyType opt = 2000;
}
option (opt) = {
any {
[type.googleapis.com/foo.bar.AnyType1] {
foo: "foo"
any {
[type.googleapis.com/foo.bar.AnyType2] {
bar: "bar"
}
}
}
}
}; |
@jvolkman Thanks for your information, I will try to add prototext support in the next version. |
@jvolkman |
I still have access to the marketplace entry but not the intellij-plugins repository. I would need to submit PRs. |
It looks like option values that are arrays are not supported, and are displayed as invalid syntax. This often breaks the entire file and also auto-formatting doesn't work.
Example from the internet:
This should be a valid protobuf option, however this how it looks actually:
The text was updated successfully, but these errors were encountered: