aboutsummaryrefslogtreecommitdiffstats
path: root/queries/proto
diff options
context:
space:
mode:
authorfrancisco souza <108725+fsouza@users.noreply.github.com>2022-04-26 15:36:26 -0400
committerStephan Seitz <stephan.seitz@fau.de>2022-04-28 00:05:57 +0200
commit1d5e4f3aa1e2368ce29c53b48b5e53702b002052 (patch)
treeb4b0620fdc121c2cdc2b0358be2423ba344207b5 /queries/proto
parentUpdate README (diff)
downloadnvim-treesitter-1d5e4f3aa1e2368ce29c53b48b5e53702b002052.tar
nvim-treesitter-1d5e4f3aa1e2368ce29c53b48b5e53702b002052.tar.gz
nvim-treesitter-1d5e4f3aa1e2368ce29c53b48b5e53702b002052.tar.bz2
nvim-treesitter-1d5e4f3aa1e2368ce29c53b48b5e53702b002052.tar.lz
nvim-treesitter-1d5e4f3aa1e2368ce29c53b48b5e53702b002052.tar.xz
nvim-treesitter-1d5e4f3aa1e2368ce29c53b48b5e53702b002052.tar.zst
nvim-treesitter-1d5e4f3aa1e2368ce29c53b48b5e53702b002052.zip
feat(proto): add parser
Related to #2307.
Diffstat (limited to 'queries/proto')
-rw-r--r--queries/proto/folds.scm5
-rw-r--r--queries/proto/highlights.scm62
2 files changed, 67 insertions, 0 deletions
diff --git a/queries/proto/folds.scm b/queries/proto/folds.scm
new file mode 100644
index 000000000..645ac1819
--- /dev/null
+++ b/queries/proto/folds.scm
@@ -0,0 +1,5 @@
+[
+ (enum)
+ (message)
+ (service)
+] @fold
diff --git a/queries/proto/highlights.scm b/queries/proto/highlights.scm
new file mode 100644
index 000000000..a859ef418
--- /dev/null
+++ b/queries/proto/highlights.scm
@@ -0,0 +1,62 @@
+[
+ "syntax"
+ "package"
+ "option"
+ "import"
+ "service"
+ "rpc"
+ "returns"
+ "message"
+ "enum"
+ "oneof"
+ "repeated"
+ "reserved"
+ "to"
+] @keyword
+
+[
+ (key_type)
+ (type)
+ (message_name)
+ (enum_name)
+ (service_name)
+ (rpc_name)
+ (message_or_enum_type)
+] @type
+
+(enum_field
+ (identifier) @constant)
+
+[
+ (string)
+ "\"proto3\""
+] @string
+
+(int_lit) @number
+
+(float_lit) @float
+
+[
+ (true)
+ (false)
+] @boolean
+
+(comment) @comment
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+ "<"
+ ">"
+] @punctuation.bracket
+
+[
+ ";"
+ ","
+] @punctuation.delimiter
+
+"=" @operator