From d24cc8ad444adf681de0909c9084a81cb6295a9a Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Thu, 28 Dec 2023 14:28:45 -0500 Subject: [PATCH] Add textobject queries for protobuf grammar. 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 runtime/queries/protobuf/textobjects.scm diff --git a/runtime/queries/protobuf/textobjects.scm b/runtime/queries/protobuf/textobjects.scm new file mode 100644 index 0000000000000..c114168109f6c --- /dev/null +++ b/runtime/queries/protobuf/textobjects.scm @@ -0,0 +1,10 @@ +(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 +