feat(proto): add proto support

This commit is contained in:
Aliaksandr Truš 2024-07-04 14:44:25 +02:00 committed by Lewis Russell
parent 1ac390aded
commit 2e5aef3d30
3 changed files with 112 additions and 1 deletions

View file

@ -66,6 +66,7 @@ Note: support for specific languages is strictly community maintained and can br
- [x] `php`
- [x] `php_only`
- [x] `prisma`
- [x] `proto`
- [x] `python`
- [x] `r`
- [x] `ruby` (and `rspec`)
@ -162,7 +163,6 @@ Note: support for specific languages is strictly community maintained and can br
- [ ] `pioasm`
- [ ] `po`
- [ ] `poe_filter`
- [ ] `proto`
- [ ] `prql`
- [ ] `pug`
- [ ] `ql`

View file

@ -0,0 +1,4 @@
([
(enum)
(message)
] @context)

107
test/lang/test.proto Normal file
View file

@ -0,0 +1,107 @@
syntax = "proto2"
package test;
// {{TEST}}
enum SomeEnum { // {{CONTEXT}}
UNDEFINED = 0
FIRST = 1
SECOND = 2
THIRD = 3
FORTH = 4
FIFTH = 5
SIXTH = 6
SEVENTH = 7
EIGHTH = 8
NINTH = 9
// {{CURSOR}}
}
// {{TEST}}
message SomeMessage { // {{CONTEXT}}
optional SomeEnum someEnum = 1;
optional string name = 2;
optional int32 id = 3;
optional int32 age = 4;
optional bool isMale = 5;
optional int32 height = 6;
optional int32 weight = 7;
optional int32 score = 8;
optional int32 level = 9;
{{CURSOR}}
}