feat: add protobuf tree-sitter parser with highlighting queries
This commit is contained in:
parent
1158fc4487
commit
4b45f27a13
4 changed files with 75 additions and 0 deletions
4
.gitmodules
vendored
4
.gitmodules
vendored
|
@ -98,3 +98,7 @@
|
|||
path = helix-syntax/languages/tree-sitter-ledger
|
||||
url = https://github.com/cbarrete/tree-sitter-ledger
|
||||
shallow = true
|
||||
[submodule "helix-syntax/languages/tree-sitter-protobuf"]
|
||||
path = helix-syntax/languages/tree-sitter-protobuf
|
||||
url = https://github.com/yusdacra/tree-sitter-protobuf.git
|
||||
shallow = true
|
||||
|
|
1
helix-syntax/languages/tree-sitter-protobuf
Submodule
1
helix-syntax/languages/tree-sitter-protobuf
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit a835f2568a8a8cbb7d9c02f2e8bcf98efa745d4e
|
|
@ -30,6 +30,16 @@ comment-token = "#"
|
|||
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
|
||||
[[language]]
|
||||
name = "protobuf"
|
||||
scope = "source.proto"
|
||||
injection-regex = "protobuf"
|
||||
file-types = ["proto"]
|
||||
roots = []
|
||||
comment-token = "//"
|
||||
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
|
||||
[[language]]
|
||||
name = "elixir"
|
||||
scope = "source.elixir"
|
||||
|
|
60
runtime/queries/protobuf/highlights.scm
Normal file
60
runtime/queries/protobuf/highlights.scm
Normal file
|
@ -0,0 +1,60 @@
|
|||
[
|
||||
"syntax"
|
||||
"package"
|
||||
"option"
|
||||
"import"
|
||||
"service"
|
||||
"rpc"
|
||||
"returns"
|
||||
"message"
|
||||
"enum"
|
||||
"oneof"
|
||||
"repeated"
|
||||
"reserved"
|
||||
"to"
|
||||
"stream"
|
||||
"extend"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
(keyType)
|
||||
(type)
|
||||
] @type.builtin
|
||||
|
||||
[
|
||||
(mapName)
|
||||
(oneofName)
|
||||
(enumName)
|
||||
(messageName)
|
||||
(extendName)
|
||||
(serviceName)
|
||||
(rpcName)
|
||||
] @type
|
||||
|
||||
[
|
||||
(fieldName)
|
||||
(optionName)
|
||||
] @property
|
||||
(enumVariantName) @type.enum.variant
|
||||
|
||||
(fullIdent) @namespace
|
||||
|
||||
[
|
||||
(intLit)
|
||||
(floatLit)
|
||||
] @number
|
||||
(boolLit) @constant.builtin
|
||||
(strLit) @string
|
||||
|
||||
(constant) @constant
|
||||
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
Loading…
Add table
Reference in a new issue