on master help sign in
Update grammar for godot (#5944)
c71b4c5Erasin
book/src/generated/lang-support.md+1−1
@@ -38,7 +38,7 @@
38| esdl | ✓ | | | |
38| esdl | ✓ | | | |
39| fish | ✓ | ✓ | ✓ | |
39| fish | ✓ | ✓ | ✓ | |
40| fortran | ✓ | | ✓ | `fortls` |
40| fortran | ✓ | | ✓ | `fortls` |
41−| gdscript | ✓ | ✓ | | |
41+| gdscript | ✓ | ✓ | ✓ | |
42| git-attributes | ✓ | | | |
42| git-attributes | ✓ | | | |
43| git-commit | ✓ | | | |
43| git-commit | ✓ | | | |
44| git-config | ✓ | | | |
44| git-config | ✓ | | | |
languages.toml+2−2
@@ -1449,13 +1449,13 @@ indent = { tab-width = 4, unit = "\t" }
1449
1449
1450[[grammar]]
1450[[grammar]]
1451name = "gdscript"
1451name = "gdscript"
1452−source = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript", rev = "2a6abdaa47fcb91397e09a97c7433fd995ea46c6" }
1452+source = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript", rev = "a56a6fcec3fb63ec3324bf9373aae7298861eb30" }
1453
1453
1454[[language]]
1454[[language]]
1455name = "godot-resource"
1455name = "godot-resource"
1456scope = "source.tscn"
1456scope = "source.tscn"
1457injection-regex = "godot"
1457injection-regex = "godot"
1458−file-types = ["tscn","tres"]
1458+file-types = ["tscn", "tres", "godot", "gdextension"]
1459shebangs = []
1459shebangs = []
1460roots = ["project.godot"]
1460roots = ["project.godot"]
1461auto-format = false
1461auto-format = false
runtime/queries/gdscript/indents.scmnew file+35
@@ -0,0 +1,35 @@
1+[
2+ (if_statement)
3+ (for_statement)
4+ (while_statement)
5+ (match_statement)
6+ (pattern_section)
7+
8+ (function_definition)
9+ (constructor_definition)
10+ (class_definition)
11+ (enum_definition)
12+
13+ (dictionary (_))
14+ (array (_))
15+] @indent
16+
17+[
18+ (if_statement)
19+ (for_statement)
20+ (while_statement)
21+ (match_statement)
22+ (pattern_section)
23+
24+ (function_definition)
25+ (class_definition)
26+] @extend
27+
28+
29+[
30+ (return_statement)
31+ (break_statement)
32+ (continue_statement)
33+ (pass_statement)
34+] @extend.prevent-once
35+
runtime/queries/gdscript/injections.scmnew file+2
@@ -0,0 +1,2 @@
1+((comment) @injection.content
2+ (#set! injection.language "comment"))
runtime/queries/godot-resource/highlights.scm+2−1
@@ -25,4 +25,5 @@
25
25
26"=" @operator
26"=" @operator
27
27
28−(ERROR) @error
28+(ERROR) @error
29+(comment) @comment
runtime/queries/godot-resource/injections.scmnew file+2
@@ -0,0 +1,2 @@
1+((comment) @injection.content
2+ (#set! injection.language "comment"))