protobuf-tmbundle icon indicating copy to clipboard operation
protobuf-tmbundle copied to clipboard

Fix rpc method regex

Open hyeonjae opened this issue 5 years ago • 1 comments

https://developers.google.com/protocol-buffers/docs/reference/proto3-spec#service_definition

1

A whitespace between rpc and rpcName is not necessary.

service SearchService {
  rpc Search (SearchRequest) returns (SearchResponse);
}

Below case should be highlighted properly.

service SearchService {
  rpc Search(SearchRequest) returns (SearchResponse);
}

2

Stream method also be highlighted.

service SomeService {
  rpc Foo (stream FooRequest) returns (FooResponse);
  rpc Bar (BarRequest) returns (stream BarResponse);
  rpc Baz (stream BazRequest) returns (stream BazResponse);
}

Regex test

Before https://regex101.com/r/8jyIIB/2 After https://regex101.com/r/h8btSr/1

hyeonjae avatar May 18 '20 13:05 hyeonjae

LGTM!

sparkstar avatar May 21 '20 08:05 sparkstar