mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
Update grammar for godot (#5944)
* update grammar for gdscript. * add comment injections for gdscript. * add indent for gdscript * add file-type support for godot-resource
This commit is contained in:
parent
ef221abe83
commit
c71b4c5579
@ -38,7 +38,7 @@
|
||||
| esdl | ✓ | | | |
|
||||
| fish | ✓ | ✓ | ✓ | |
|
||||
| fortran | ✓ | | ✓ | `fortls` |
|
||||
| gdscript | ✓ | ✓ | | |
|
||||
| gdscript | ✓ | ✓ | ✓ | |
|
||||
| git-attributes | ✓ | | | |
|
||||
| git-commit | ✓ | | | |
|
||||
| git-config | ✓ | | | |
|
||||
|
@ -1449,13 +1449,13 @@ indent = { tab-width = 4, unit = "\t" }
|
||||
|
||||
[[grammar]]
|
||||
name = "gdscript"
|
||||
source = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript", rev = "2a6abdaa47fcb91397e09a97c7433fd995ea46c6" }
|
||||
source = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript", rev = "a56a6fcec3fb63ec3324bf9373aae7298861eb30" }
|
||||
|
||||
[[language]]
|
||||
name = "godot-resource"
|
||||
scope = "source.tscn"
|
||||
injection-regex = "godot"
|
||||
file-types = ["tscn","tres"]
|
||||
file-types = ["tscn", "tres", "godot", "gdextension"]
|
||||
shebangs = []
|
||||
roots = ["project.godot"]
|
||||
auto-format = false
|
||||
|
35
runtime/queries/gdscript/indents.scm
Normal file
35
runtime/queries/gdscript/indents.scm
Normal file
@ -0,0 +1,35 @@
|
||||
[
|
||||
(if_statement)
|
||||
(for_statement)
|
||||
(while_statement)
|
||||
(match_statement)
|
||||
(pattern_section)
|
||||
|
||||
(function_definition)
|
||||
(constructor_definition)
|
||||
(class_definition)
|
||||
(enum_definition)
|
||||
|
||||
(dictionary (_))
|
||||
(array (_))
|
||||
] @indent
|
||||
|
||||
[
|
||||
(if_statement)
|
||||
(for_statement)
|
||||
(while_statement)
|
||||
(match_statement)
|
||||
(pattern_section)
|
||||
|
||||
(function_definition)
|
||||
(class_definition)
|
||||
] @extend
|
||||
|
||||
|
||||
[
|
||||
(return_statement)
|
||||
(break_statement)
|
||||
(continue_statement)
|
||||
(pass_statement)
|
||||
] @extend.prevent-once
|
||||
|
2
runtime/queries/gdscript/injections.scm
Normal file
2
runtime/queries/gdscript/injections.scm
Normal file
@ -0,0 +1,2 @@
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
@ -26,3 +26,4 @@
|
||||
"=" @operator
|
||||
|
||||
(ERROR) @error
|
||||
(comment) @comment
|
||||
|
2
runtime/queries/godot-resource/injections.scm
Normal file
2
runtime/queries/godot-resource/injections.scm
Normal file
@ -0,0 +1,2 @@
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
Loading…
Reference in New Issue
Block a user