-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
(protobuf) service definition seems to break highlighting #2351
Comments
Would it be possible to get this as a jsfiddle reproducible sample please? You can use my template: |
@YamiOdymel Thanks so much! |
Don't you need a |
It seems like when a line ended with a example from: golang/protobuf#205 package example;
enum FOO { X = 17; }
message Test {
required string label = 1;
optional int32 type = 2 [default=77];
repeated int64 reps = 3;
optional group OptionalGroup = 4 {
required string RequiredField = 5;
}
oneof union {
int32 number = 6;
string name = 7;
}
} |
All the examples I find look like:
What is the |
Well, I think it's a little bit complex, but I've seen people put the metadata in the https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/proto/examplepb/stream.proto import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "examples/proto/examplepb/a_bit_of_everything.proto";
import "examples/proto/sub/message.proto";
// Defines some more operations to be added to ABitOfEverythingService
service StreamService {
rpc BulkCreate(stream ABitOfEverything) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/example/a_bit_of_everything/bulk"
body: "*"
};
}
rpc List(google.protobuf.Empty) returns (stream ABitOfEverything) {
option (google.api.http) = {
get: "/v1/example/a_bit_of_everything"
};
}
rpc BulkEcho(stream grpc.gateway.examples.sub.StringMessage) returns (stream grpc.gateway.examples.sub.StringMessage) {
option (google.api.http) = {
post: "/v1/example/a_bit_of_everything/echo"
body: "*"
};
}
} |
Oh, that looks great. I'd also like to ask, will it also be highlighted as well if I put the metadata inside of the |
It would be highlighted with whatever rules were typically used for code inside a |
* fix(protobuf) Fix `rpc` when followed by a block Resolves #2351.
* fix(protobuf) Fix `rpc` when followed by a block Resolves highlightjs#2351.
A service definition became a non-closed function that cause the comment is not well highlighted. (the
// The request message containing the user's name.
part)The original picture without DOM tooltip.
The example code is from the official example.
The text was updated successfully, but these errors were encountered: