summaryrefslogtreecommitdiff
path: root/queries
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
parent9fdd6765fc05632c2f3af1ad825dc4e9cc0b041f (diff)
feat(proto): add parser
Related to #2307.
Diffstat (limited to 'queries')
-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 00000000..645ac181
--- /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 00000000..a859ef41
--- /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