Skip to content

Commit 8db2d41

Browse files
committed
Update the tree sitter GDScript parser
Close #120 Close #124
1 parent 16415ab commit 8db2d41

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ default-run = "gdscript-formatter"
1010
[dependencies]
1111
clap = { version = "4.0", features = ["derive", "wrap_help"] }
1212
topiary-core = { git = "https://github.com/tweag/topiary", rev = "5081ccef9245fe56c2b3e2a7ced52277eda45825" }
13-
tree-sitter-gdscript = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript.git", rev = "0b9f60ebaa1c31f5153dd3a3b283ca0725734378" }
13+
tree-sitter-gdscript = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript.git", rev = "839cd921c8aa8b79c9afe2eb71a6a7bfa809e995" }
1414
regex = "1.11"
1515
tree-sitter = "0.25.10"
1616
rayon = "1.11.0"

tests/expected/comments_basic.gd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ func do_another_thing() -> void:
2626
pass
2727

2828
# likewise, this comment should stay inside of this function block
29+
30+
31+
func test_function():
32+
var a = "test"
33+
# This comment should stay inside of the function body
34+
print(a)

tests/input/comments_basic.gd

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,18 @@ func do_thing() -> void:
1616
if true:
1717
# this is a comment inside of the function block
1818
pass
19-
19+
2020
# this is a comment at the end of the function block
2121
# it should stay inside of this function block
2222

2323

2424
func do_another_thing() -> void:
2525
pass
2626

27-
# likewise, this comment should stay inside of this function block
27+
# likewise, this comment should stay inside of this function block
28+
29+
30+
func test_function():
31+
var a = "test"
32+
# This comment should stay inside of the function body
33+
print(a)

0 commit comments

Comments
 (0)