aboutsummaryrefslogtreecommitdiff
path: root/Queries/highlights.scm
diff options
context:
space:
mode:
authorDavid Czihak <git@dcz.at>2026-05-07 14:33:19 +0200
committerDavid Czihak <git@dcz.at>2026-05-07 14:33:19 +0200
commitddf2de739068b5ff0866ccb1d067f3cb53a4fc55 (patch)
tree1a77efe9d73a6172be3c37d29b321eadd4efe379 /Queries/highlights.scm
Initial commitv0.1.7
Diffstat (limited to 'Queries/highlights.scm')
-rw-r--r--Queries/highlights.scm123
1 files changed, 123 insertions, 0 deletions
diff --git a/Queries/highlights.scm b/Queries/highlights.scm
new file mode 100644
index 0000000..b366bc7
--- /dev/null
+++ b/Queries/highlights.scm
@@ -0,0 +1,123 @@
+(comment) @comment
+
+[
+ (string)
+ (multiline_string)
+ (character)
+] @string
+
+[
+ (integer)
+ (float)
+] @value.number
+
+[
+ "true"
+ "false"
+] @value.boolean
+
+[
+ "null"
+ "undefined"
+ "unreachable"
+] @value.null
+
+(builtin_type) @identifier.type
+(builtin_identifier) @identifier.core
+
+((builtin_identifier) @processing
+ (#match? @processing "^@(import|cImport)$"))
+
+((identifier) @identifier.core
+ (#eq? @identifier.core "_"))
+
+(parameter
+ name: (identifier) @identifier.argument)
+
+(payload
+ (identifier) @identifier.argument)
+
+(field_expression
+ member: (identifier) @identifier.property)
+
+(field_initializer
+ (identifier) @identifier.property)
+
+(function_declaration
+ name: (identifier) @identifier.function)
+
+(call_expression
+ function: (identifier) @identifier.function)
+
+(call_expression
+ function: (field_expression
+ member: (identifier) @identifier.function))
+
+((identifier) @identifier.type
+ (#match? @identifier.type "^[A-Z][A-Za-z0-9_]*$"))
+
+((identifier) @identifier.constant
+ (#match? @identifier.constant "^[A-Z][A-Z0-9_]+$"))
+
+[
+ "asm"
+ "const"
+ "defer"
+ "errdefer"
+ "error"
+ "return"
+ "test"
+ "var"
+] @keyword
+
+[
+ "struct"
+ "union"
+ "enum"
+ "opaque"
+ "fn"
+] @keyword.construct
+
+[
+ "if"
+ "else"
+ "switch"
+ "for"
+ "while"
+ "try"
+ "catch"
+ "break"
+ "continue"
+] @keyword.condition
+
+[
+ "usingnamespace"
+ "export"
+ "comptime"
+ "inline"
+ "noinline"
+ "extern"
+ "pub"
+ "packed"
+ "threadlocal"
+ "volatile"
+ "allowzero"
+ "noalias"
+ "addrspace"
+ "align"
+ "callconv"
+ "linksection"
+ "async"
+ "await"
+ "suspend"
+ "nosuspend"
+ "resume"
+] @keyword.modifier
+
+[
+ "and"
+ "or"
+ "orelse"
+] @keyword.operator
+
+(ERROR) @invalid