1
0
mirror of https://github.com/helix-editor/helix synced 2024-11-10 10:34:45 +01:00

feat: add protobuf tree-sitter parser with highlighting queries

This commit is contained in:
Yusuf Bera Ertan 2021-08-18 13:54:47 +03:00 committed by Blaž Hrastnik
parent 1158fc4487
commit 4b45f27a13
4 changed files with 75 additions and 0 deletions

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

@ -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"

@ -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