From c8e58304bf4b1b327067bd92ca6e3c9db897c572 Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Sun, 7 Jan 2024 21:08:41 -0500 Subject: Add textobject queries for protobuf grammar. (#9184) Given `message Foo {string s = 1;}` - `mat` selects `message Foo {string s = 1}` - `mit` selects `{string s = 1;}` Given `service SearchService { rpc Search(Req) returns (Resp); } - `mit` or `mat` selects `Req` or `Resp` - `mif` or `maf` selects `rpc Search(Req) returns (Resp);` - `mit` selects { rpc Search(Req) returns (Resp); }` - `mat` selects `service SearchService { rpc Search(Req) returns (Resp); }`--- runtime/queries/protobuf/textobjects.scm | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 runtime/queries/protobuf/textobjects.scm (limited to 'runtime/queries/protobuf') diff --git a/runtime/queries/protobuf/textobjects.scm b/runtime/queries/protobuf/textobjects.scm new file mode 100644 index 00000000..6f06b134 --- /dev/null +++ b/runtime/queries/protobuf/textobjects.scm @@ -0,0 +1,9 @@ +(message (messageBody) @class.inside) @class.around +(enum (enumBody) @class.inside) @class.around +(service (serviceBody) @class.inside) @class.around + +(rpc (enumMessageType) @parameter.inside) @function.inside +(rpc (enumMessageType) @parameter.around) @function.around + +(comment) @comment.inside +(comment)+ @comment.around -- cgit v1.2.3-70-g09d2