mirror of
https://github.com/nvim-treesitter/nvim-treesitter-context
synced 2024-09-16 14:14:03 +02:00
feat(proto): add proto support
This commit is contained in:
parent
1ac390aded
commit
2e5aef3d30
3 changed files with 112 additions and 1 deletions
|
@ -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`
|
||||
|
|
4
queries/proto/context.scm
Normal file
4
queries/proto/context.scm
Normal file
|
@ -0,0 +1,4 @@
|
|||
([
|
||||
(enum)
|
||||
(message)
|
||||
] @context)
|
107
test/lang/test.proto
Normal file
107
test/lang/test.proto
Normal 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}}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue