aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries
diff options
context:
space:
mode:
author巢鹏2024-02-27 00:41:50 +0000
committerGitHub2024-02-27 00:41:50 +0000
commit358ac6bc1f512ca7303856dc904d4b4cdc1fe718 (patch)
tree1ace307facd047fb7ac1de6505368fd14c6c1b95 /runtime/queries
parent1a82aeeae91be33cb0923c9f652fa6db250efd7f (diff)
add fidl support (#9713)
Diffstat (limited to 'runtime/queries')
-rw-r--r--runtime/queries/fidl/folds.scm6
-rw-r--r--runtime/queries/fidl/highlights.scm64
-rw-r--r--runtime/queries/fidl/injections.scm2
3 files changed, 72 insertions, 0 deletions
diff --git a/runtime/queries/fidl/folds.scm b/runtime/queries/fidl/folds.scm
new file mode 100644
index 00000000..f524c455
--- /dev/null
+++ b/runtime/queries/fidl/folds.scm
@@ -0,0 +1,6 @@
+[
+ (layout_declaration)
+ (protocol_declaration)
+ (resource_declaration)
+ (service_declaration)
+] @fold
diff --git a/runtime/queries/fidl/highlights.scm b/runtime/queries/fidl/highlights.scm
new file mode 100644
index 00000000..c70d2219
--- /dev/null
+++ b/runtime/queries/fidl/highlights.scm
@@ -0,0 +1,64 @@
+[
+ "ajar"
+ "alias"
+ "as"
+ "bits"
+ "closed"
+ "compose"
+ "const"
+ "enum"
+ "error"
+ "flexible"
+ "library"
+ "open"
+ ; "optional" we did not specify a node for optional yet
+ "overlay"
+ "protocol"
+ "reserved"
+ "resource"
+ "service"
+ "strict"
+ "struct"
+ "table"
+ "type"
+ "union"
+ "using"
+] @keyword
+
+(primitives_type) @type.builtin
+
+(builtin_complex_type) @type.builtin
+
+(const_declaration
+ (identifier) @constant)
+
+[
+ "="
+ "|"
+ "&"
+ "->"
+] @operator
+
+(attribute
+ "@" @attribute
+ (identifier) @attribute)
+
+(string_literal) @string
+
+(numeric_literal) @constant.numeric
+
+[
+ (true)
+ (false)
+] @constant.builtin.boolean
+
+(comment) @comment
+
+[
+ "("
+ ")"
+ "<"
+ ">"
+ "{"
+ "}"
+] @punctuation.bracket
diff --git a/runtime/queries/fidl/injections.scm b/runtime/queries/fidl/injections.scm
new file mode 100644
index 00000000..2f0e58eb
--- /dev/null
+++ b/runtime/queries/fidl/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))