helix-mods/runtime/queries/gdscript/highlights.scm

133 lines
1.6 KiB
Scheme
Raw Normal View History

2022-04-15 17:35:23 +02:00
; Identifier naming conventions
2023-03-05 19:41:18 +01:00
(
(identifier) @constant
(#match? @constant "^[A-Z][A-Z\\d_]+$"))
2022-04-15 17:35:23 +02:00
2022-09-10 15:47:08 +02:00
; class
(class_name_statement (name) @type)
(class_definition (name) @type)
2022-04-15 17:35:23 +02:00
; Function calls
(attribute_call (identifier) @function)
(base_call (identifier) @function)
(call (identifier) @function)
; Function definitions
(function_definition (name) @function)
(constructor_definition "_init" @function)
2023-03-05 19:41:18 +01:00
2022-04-15 17:35:23 +02:00
;; Literals
(comment) @comment
(string) @string
2023-03-05 19:41:18 +01:00
2022-04-15 17:35:23 +02:00
(type) @type
2023-03-05 19:41:18 +01:00
(expression_statement (array (identifier) @type))
(binary_operator (identifier) @type)
2022-04-15 17:35:23 +02:00
2023-03-05 19:41:18 +01:00
(variable_statement (identifier) @variable)
(get_node) @label
(const_statement (name) @constant)
(integer) @constant.numeric.integer
(float) @constant.numeric.float
(escape_sequence) @constant.character.escape
2022-04-15 17:35:23 +02:00
[
(true)
(false)
2023-03-05 19:41:18 +01:00
] @constant.builtin.boolean
(null) @constant.builtin
2022-04-15 17:35:23 +02:00
[
"+"
"-"
"*"
"/"
"%"
"=="
"!="
">"
"<"
">="
"<="
"="
"+="
"-="
"*="
"/="
"%="
"&"
"|"
"^"
"~"
"<<"
">>"
] @operator
2023-03-05 19:41:18 +01:00
(annotation (identifier) @keyword.storage.modifier)
2022-04-15 17:35:23 +02:00
[
"if"
"else"
"elif"
2023-03-05 19:41:18 +01:00
] @keyword.control.conditional
[
2022-04-15 17:35:23 +02:00
"while"
"for"
2023-03-05 19:41:18 +01:00
] @keyword.control.repeat
[
2022-04-15 17:35:23 +02:00
"return"
2023-03-05 19:41:18 +01:00
"pass"
2022-04-15 17:35:23 +02:00
"break"
"continue"
2023-03-05 19:41:18 +01:00
] @keyword.control.return
[
"func"
] @keyword.control.function
[
"export"
] @keyword.control.import
[
"in"
"is"
"as"
2022-04-15 17:35:23 +02:00
"match"
2023-03-05 19:41:18 +01:00
"and"
"or"
"not"
] @keyword.operator
[
"var"
2022-04-15 17:35:23 +02:00
"class"
"class_name"
"enum"
2023-03-05 19:41:18 +01:00
] @keyword.storage.type
[
(remote_keyword)
(static_keyword)
"const"
2022-04-15 17:35:23 +02:00
"signal"
2023-03-05 19:41:18 +01:00
"@"
] @keyword.storage.modifier
[
"setget"
2022-04-15 17:35:23 +02:00
"onready"
"extends"
2023-03-05 19:41:18 +01:00
"set"
"get"
2022-04-15 17:35:23 +02:00
] @keyword
2023-03-05 19:41:18 +01:00