feat(sproto): add parser

This commit is contained in:
涵曦 2025-08-11 15:21:23 +08:00 committed by Christian Clason
parent 9866036ec3
commit 13e3ce3bf4
6 changed files with 74 additions and 0 deletions

View file

@ -269,6 +269,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka
[sosl](https://github.com/aheber/tree-sitter-sfapex) | unstable | `H    ` | | @aheber, @xixiafinland
[sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) | unstable | `H  JL` | | @Sarrus1
[sparql](https://github.com/GordianDziwis/tree-sitter-sparql) | unstable | `HFIJL` | | @GordianDziwis
[sproto](https://github.com/hanxi/tree-sitter-sproto) | unstable | `HFIJ ` | | @hanxi
[sql](https://github.com/derekstride/tree-sitter-sql) | unstable | `HFIJ ` | | @derekstride
[squirrel](https://github.com/tree-sitter-grammars/tree-sitter-squirrel) | unstable | `HFIJL` | | @amaanq
[ssh_config](https://github.com/tree-sitter-grammars/tree-sitter-ssh-config) | unstable | `HFIJL` | | @ObserverOfTime

View file

@ -2115,6 +2115,14 @@ return {
maintainers = { '@GordianDziwis' },
tier = 2,
},
sproto = {
install_info = {
revision = 'd554c1456e35e7b2690552d52921c987d0cf6799',
url = 'https://github.com/hanxi/tree-sitter-sproto',
},
maintainers = { '@hanxi' },
tier = 2,
},
sql = {
install_info = {
branch = 'gh-pages',

View file

@ -0,0 +1,6 @@
[
(type_definition)
(protocol_definition)
(request_block)
(response_block)
] @fold

View 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

View file

@ -0,0 +1,10 @@
[
(type_definition)
(protocol_definition)
(request_block)
(response_block)
] @indent.begin
"}" @indent.end @indent.branch
(comment) @indent.auto

View file

@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))