mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-10-26 17:23:34 +03:00
Update queries for godot4 (#6186)
This commit is contained in:
parent
def26966d2
commit
e6597bc992
@ -1463,7 +1463,7 @@ indent = { tab-width = 4, unit = "\t" }
|
|||||||
|
|
||||||
[[grammar]]
|
[[grammar]]
|
||||||
name = "gdscript"
|
name = "gdscript"
|
||||||
source = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript", rev = "a56a6fcec3fb63ec3324bf9373aae7298861eb30" }
|
source = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript", rev = "a4b57cc3bcbfc24550e858159647e9238e7ad1ac" }
|
||||||
|
|
||||||
[[language]]
|
[[language]]
|
||||||
name = "godot-resource"
|
name = "godot-resource"
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
; Identifier naming conventions
|
; Identifier naming conventions
|
||||||
|
|
||||||
((identifier) @constant
|
(
|
||||||
(#match? @constant "^[A-Z][A-Z_]*$"))
|
(identifier) @constant
|
||||||
|
(#match? @constant "^[A-Z][A-Z\\d_]+$"))
|
||||||
|
|
||||||
; class
|
; class
|
||||||
(class_name_statement (name) @type)
|
(class_name_statement (name) @type)
|
||||||
@ -11,32 +12,35 @@
|
|||||||
; Function calls
|
; Function calls
|
||||||
|
|
||||||
(attribute_call (identifier) @function)
|
(attribute_call (identifier) @function)
|
||||||
|
|
||||||
(base_call (identifier) @function)
|
(base_call (identifier) @function)
|
||||||
|
|
||||||
(call (identifier) @function)
|
(call (identifier) @function)
|
||||||
|
|
||||||
; Function definitions
|
; Function definitions
|
||||||
|
|
||||||
(function_definition (name) @function)
|
(function_definition (name) @function)
|
||||||
|
|
||||||
(constructor_definition "_init" @function)
|
(constructor_definition "_init" @function)
|
||||||
|
|
||||||
;; Literals
|
|
||||||
(integer) @constant.numeric.integer
|
|
||||||
(float) @constant.numeric.float
|
|
||||||
(comment) @comment
|
|
||||||
(string) @string
|
|
||||||
(escape_sequence) @constant.character.escape
|
|
||||||
(identifier) @variable
|
|
||||||
(type) @type
|
|
||||||
|
|
||||||
;; Literals
|
;; Literals
|
||||||
|
(comment) @comment
|
||||||
|
(string) @string
|
||||||
|
|
||||||
|
(type) @type
|
||||||
|
(expression_statement (array (identifier) @type))
|
||||||
|
(binary_operator (identifier) @type)
|
||||||
|
|
||||||
|
(variable_statement (identifier) @variable)
|
||||||
|
(get_node) @label
|
||||||
|
|
||||||
|
(const_statement (name) @constant)
|
||||||
|
(integer) @constant.numeric.integer
|
||||||
|
(float) @constant.numeric.float
|
||||||
|
(escape_sequence) @constant.character.escape
|
||||||
[
|
[
|
||||||
(true)
|
(true)
|
||||||
(false)
|
(false)
|
||||||
(null)
|
] @constant.builtin.boolean
|
||||||
] @constant.builtin
|
(null) @constant.builtin
|
||||||
|
|
||||||
[
|
[
|
||||||
"+"
|
"+"
|
||||||
@ -62,37 +66,67 @@
|
|||||||
"~"
|
"~"
|
||||||
"<<"
|
"<<"
|
||||||
">>"
|
">>"
|
||||||
"and"
|
|
||||||
"or"
|
|
||||||
"not"
|
|
||||||
] @operator
|
] @operator
|
||||||
|
|
||||||
|
(annotation (identifier) @keyword.storage.modifier)
|
||||||
|
|
||||||
[
|
[
|
||||||
(static_keyword)
|
|
||||||
(remote_keyword)
|
|
||||||
(tool_statement)
|
|
||||||
"var"
|
|
||||||
"func"
|
|
||||||
"setget"
|
|
||||||
"in"
|
|
||||||
"is"
|
|
||||||
"as"
|
|
||||||
"if"
|
"if"
|
||||||
"else"
|
"else"
|
||||||
"elif"
|
"elif"
|
||||||
|
] @keyword.control.conditional
|
||||||
|
|
||||||
|
[
|
||||||
"while"
|
"while"
|
||||||
"for"
|
"for"
|
||||||
|
] @keyword.control.repeat
|
||||||
|
|
||||||
|
[
|
||||||
"return"
|
"return"
|
||||||
|
"pass"
|
||||||
"break"
|
"break"
|
||||||
"continue"
|
"continue"
|
||||||
"pass"
|
] @keyword.control.return
|
||||||
|
|
||||||
|
[
|
||||||
|
"func"
|
||||||
|
] @keyword.control.function
|
||||||
|
|
||||||
|
[
|
||||||
|
"export"
|
||||||
|
] @keyword.control.import
|
||||||
|
|
||||||
|
[
|
||||||
|
"in"
|
||||||
|
"is"
|
||||||
|
"as"
|
||||||
"match"
|
"match"
|
||||||
|
"and"
|
||||||
|
"or"
|
||||||
|
"not"
|
||||||
|
] @keyword.operator
|
||||||
|
|
||||||
|
[
|
||||||
|
"var"
|
||||||
"class"
|
"class"
|
||||||
"class_name"
|
"class_name"
|
||||||
"enum"
|
"enum"
|
||||||
"signal"
|
] @keyword.storage.type
|
||||||
"onready"
|
|
||||||
"export"
|
|
||||||
"extends"
|
[
|
||||||
|
(remote_keyword)
|
||||||
|
(static_keyword)
|
||||||
"const"
|
"const"
|
||||||
|
"signal"
|
||||||
|
"@"
|
||||||
|
] @keyword.storage.modifier
|
||||||
|
|
||||||
|
[
|
||||||
|
"setget"
|
||||||
|
"onready"
|
||||||
|
"extends"
|
||||||
|
"set"
|
||||||
|
"get"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
(dictionary (_))
|
(dictionary (_))
|
||||||
(array (_))
|
(array (_))
|
||||||
|
(setget)
|
||||||
] @indent
|
] @indent
|
||||||
|
|
||||||
[
|
[
|
||||||
@ -25,7 +26,6 @@
|
|||||||
(class_definition)
|
(class_definition)
|
||||||
] @extend
|
] @extend
|
||||||
|
|
||||||
|
|
||||||
[
|
[
|
||||||
(return_statement)
|
(return_statement)
|
||||||
(break_statement)
|
(break_statement)
|
||||||
|
@ -1,2 +1,18 @@
|
|||||||
((comment) @injection.content
|
((comment) @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#set! injection.language "comment"))
|
||||||
|
|
||||||
|
; ((section) @injection.content
|
||||||
|
; (#set! injection.language "comment"))
|
||||||
|
|
||||||
|
((section
|
||||||
|
(attribute
|
||||||
|
(identifier) @_type
|
||||||
|
(string) @_is_shader)
|
||||||
|
(property
|
||||||
|
(path) @_is_code
|
||||||
|
(string) @injection.content))
|
||||||
|
(#match? @_type "type")
|
||||||
|
(#match? @_is_shader "Shader")
|
||||||
|
(#eq? @_is_code "code")
|
||||||
|
(#set! injection.language "glsl")
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user