mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-07 14:00:00 -04:00
feat(sproto): add parser
This commit is contained in:
parent
9866036ec3
commit
13e3ce3bf4
6 changed files with 74 additions and 0 deletions
6
runtime/queries/sproto/folds.scm
Normal file
6
runtime/queries/sproto/folds.scm
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
(type_definition)
|
||||
(protocol_definition)
|
||||
(request_block)
|
||||
(response_block)
|
||||
] @fold
|
||||
47
runtime/queries/sproto/highlights.scm
Normal file
47
runtime/queries/sproto/highlights.scm
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
(comment) @comment @spell
|
||||
|
||||
[
|
||||
"."
|
||||
":"
|
||||
] @punctuation.delimiter
|
||||
|
||||
"*" @operator
|
||||
|
||||
[
|
||||
"request"
|
||||
"response"
|
||||
] @keyword
|
||||
|
||||
(type_definition
|
||||
name: (identifier) @type)
|
||||
|
||||
(nested_type_definition
|
||||
name: (identifier) @type)
|
||||
|
||||
(type_specifier) @type
|
||||
|
||||
[
|
||||
"integer"
|
||||
"boolean"
|
||||
"string"
|
||||
"binary"
|
||||
"double"
|
||||
] @type.builtin
|
||||
|
||||
(protocol_definition
|
||||
name: (identifier) @function)
|
||||
|
||||
(field_definition
|
||||
name: (identifier) @property)
|
||||
|
||||
(map_specifier
|
||||
key: (identifier) @property)
|
||||
|
||||
(integer) @number
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
10
runtime/queries/sproto/indents.scm
Normal file
10
runtime/queries/sproto/indents.scm
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[
|
||||
(type_definition)
|
||||
(protocol_definition)
|
||||
(request_block)
|
||||
(response_block)
|
||||
] @indent.begin
|
||||
|
||||
"}" @indent.end @indent.branch
|
||||
|
||||
(comment) @indent.auto
|
||||
2
runtime/queries/sproto/injections.scm
Normal file
2
runtime/queries/sproto/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue