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); }`
This commit is contained in:
Ryan Roden-Corrent 2024-01-07 21:08:41 -05:00 committed by GitHub
parent 154d9b6ed1
commit c8e58304bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -128,7 +128,7 @@
| ponylang | ✓ | ✓ | ✓ | |
| prisma | ✓ | | | `prisma-language-server` |
| prolog | | | | `swipl` |
| protobuf | ✓ | | ✓ | `bufls`, `pb` |
| protobuf | ✓ | | ✓ | `bufls`, `pb` |
| prql | ✓ | | | |
| purescript | ✓ | ✓ | | `purescript-language-server` |
| python | ✓ | ✓ | ✓ | `pylsp` |

View file

@ -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