Skip to content

Commit

Permalink
Add textobject queries for protobuf grammar.
Browse files Browse the repository at this point in the history
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); }`
  • Loading branch information
rcorre committed Dec 28, 2023
1 parent 783ff27 commit d24cc8a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions runtime/queries/protobuf/textobjects.scm
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d24cc8a

Please sign in to comment.