mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-11-28 21:20:23 +03:00
gdscript support (#1985)
This commit is contained in:
parent
893963df0a
commit
50df924811
@ -16,6 +16,7 @@
|
||||
| erb | ✓ | | | |
|
||||
| erlang | ✓ | | | `erlang_ls` |
|
||||
| fish | ✓ | ✓ | ✓ | |
|
||||
| gdscript | ✓ | | ✓ | |
|
||||
| git-commit | ✓ | | | |
|
||||
| git-config | ✓ | | | |
|
||||
| git-diff | ✓ | | | |
|
||||
|
@ -1150,3 +1150,18 @@ injection-regex = "sql"
|
||||
[[grammar]]
|
||||
name = "sql"
|
||||
source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "0caa7fa2ee00e0b770493a79d4efacc1fc376cc5" }
|
||||
|
||||
[[language]]
|
||||
name = "gdscript"
|
||||
scope = "source.gdscript"
|
||||
injection-regex = "gdscript"
|
||||
file-types = ["gd"]
|
||||
shebangs = []
|
||||
roots = ["project.godot"]
|
||||
auto-format = true
|
||||
comment-token = "#"
|
||||
indent = { tab-width = 4, unit = " " }
|
||||
|
||||
[[grammar]]
|
||||
name = "gdscript"
|
||||
source = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript", rev = "2a6abdaa47fcb91397e09a97c7433fd995ea46c6" }
|
||||
|
93
runtime/queries/gdscript/highlights.scm
Normal file
93
runtime/queries/gdscript/highlights.scm
Normal file
@ -0,0 +1,93 @@
|
||||
; Identifier naming conventions
|
||||
|
||||
((identifier) @constant
|
||||
(#match? @constant "^[A-Z][A-Z_]*$"))
|
||||
|
||||
; Function calls
|
||||
|
||||
(attribute_call (identifier) @function)
|
||||
|
||||
(base_call (identifier) @function)
|
||||
|
||||
(call (identifier) @function)
|
||||
|
||||
; Function definitions
|
||||
|
||||
(function_definition (name) @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
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
(null)
|
||||
] @constant.builtin
|
||||
|
||||
[
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"/"
|
||||
"%"
|
||||
"=="
|
||||
"!="
|
||||
">"
|
||||
"<"
|
||||
">="
|
||||
"<="
|
||||
"="
|
||||
"+="
|
||||
"-="
|
||||
"*="
|
||||
"/="
|
||||
"%="
|
||||
"&"
|
||||
"|"
|
||||
"^"
|
||||
"~"
|
||||
"<<"
|
||||
">>"
|
||||
"and"
|
||||
"or"
|
||||
"not"
|
||||
] @operator
|
||||
|
||||
[
|
||||
(static_keyword)
|
||||
(remote_keyword)
|
||||
(tool_statement)
|
||||
"var"
|
||||
"func"
|
||||
"setget"
|
||||
"in"
|
||||
"is"
|
||||
"as"
|
||||
"if"
|
||||
"else"
|
||||
"elif"
|
||||
"while"
|
||||
"for"
|
||||
"return"
|
||||
"break"
|
||||
"continue"
|
||||
"pass"
|
||||
"match"
|
||||
"class"
|
||||
"class_name"
|
||||
"enum"
|
||||
"signal"
|
||||
"onready"
|
||||
"export"
|
||||
"extends"
|
||||
"const"
|
||||
] @keyword
|
26
runtime/queries/gdscript/indents.scm
Normal file
26
runtime/queries/gdscript/indents.scm
Normal file
@ -0,0 +1,26 @@
|
||||
[
|
||||
(_compound_statement)
|
||||
(match_statement)
|
||||
(parenthesized_expression)
|
||||
|
||||
(pattern_array)
|
||||
(pattern_dictionary)
|
||||
(argument_list)
|
||||
(binary_operator)
|
||||
|
||||
(parameters)
|
||||
(body)
|
||||
(enumerator_list)
|
||||
|
||||
(function_definition)
|
||||
(constructor_definition)
|
||||
(class_definition)
|
||||
] @indent
|
||||
|
||||
[
|
||||
")",
|
||||
"]",
|
||||
"}",
|
||||
(return_statement)
|
||||
(pass_statement)
|
||||
] @outdent
|
5
runtime/queries/gdscript/tags.scm
Normal file
5
runtime/queries/gdscript/tags.scm
Normal file
@ -0,0 +1,5 @@
|
||||
(class_definition (name) @name) @definition.class
|
||||
|
||||
(function_definition (name) @name) @definition.function
|
||||
|
||||
(call (name) @name) @reference.call
|
Loading…
Reference in New Issue
Block a user