aboutsummaryrefslogtreecommitdiffstats
path: root/queries
diff options
context:
space:
mode:
author巢鹏 <chaopeng@chaopeng.me>2024-02-22 21:57:07 -0500
committerGitHub <noreply@github.com>2024-02-23 11:57:07 +0900
commita8d2b54e28b25cbea1a5fae312165f56674168de (patch)
tree1ffac806962b419cc692558f3a7fc910232b63ee /queries
parentfeat(c-sharp): add enum member declaration highlight query (diff)
downloadnvim-treesitter-a8d2b54e28b25cbea1a5fae312165f56674168de.tar
nvim-treesitter-a8d2b54e28b25cbea1a5fae312165f56674168de.tar.gz
nvim-treesitter-a8d2b54e28b25cbea1a5fae312165f56674168de.tar.bz2
nvim-treesitter-a8d2b54e28b25cbea1a5fae312165f56674168de.tar.lz
nvim-treesitter-a8d2b54e28b25cbea1a5fae312165f56674168de.tar.xz
nvim-treesitter-a8d2b54e28b25cbea1a5fae312165f56674168de.tar.zst
nvim-treesitter-a8d2b54e28b25cbea1a5fae312165f56674168de.zip
feat: add fidl parser
Diffstat (limited to 'queries')
-rw-r--r--queries/fidl/folds.scm6
-rw-r--r--queries/fidl/highlights.scm64
-rw-r--r--queries/fidl/injections.scm2
3 files changed, 72 insertions, 0 deletions
diff --git a/queries/fidl/folds.scm b/queries/fidl/folds.scm
new file mode 100644
index 000000000..f524c455b
--- /dev/null
+++ b/queries/fidl/folds.scm
@@ -0,0 +1,6 @@
+[
+ (layout_declaration)
+ (protocol_declaration)
+ (resource_declaration)
+ (service_declaration)
+] @fold
diff --git a/queries/fidl/highlights.scm b/queries/fidl/highlights.scm
new file mode 100644
index 000000000..ce7727010
--- /dev/null
+++ b/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) @number
+
+[
+ (true)
+ (false)
+] @boolean
+
+(comment) @comment
+
+[
+ "("
+ ")"
+ "<"
+ ">"
+ "{"
+ "}"
+] @punctuation.bracket
diff --git a/queries/fidl/injections.scm b/queries/fidl/injections.scm
new file mode 100644
index 000000000..2f0e58eb6
--- /dev/null
+++ b/queries/fidl/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))