Skip to content

Commit ae2d443

Browse files
authored
Merge pull request #117 from TranquilMarmot/update-tree-sitter-trailing-comments
Update tree-sitter-gdscript to fix trailing comments and negated async
2 parents 5196e92 + 4c0346d commit ae2d443

File tree

6 files changed

+39
-2
lines changed

6 files changed

+39
-2
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"] }
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 = "55d1b51f9ab6c60c21098935014b5431f0ec7ef0" }
13+
tree-sitter-gdscript = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript.git", rev = "0b9f60ebaa1c31f5153dd3a3b283ca0725734378" }
1414
regex = "1.11"
1515
tree-sitter = "0.25.10"
1616
rayon = "1.11.0"

tests/expected/await.gd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
var normal = await test()
2+
3+
var negated := not await test()

tests/expected/comments_basic.gd

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,18 @@ var a = 10 # inline comment
1111

1212
var b = 10
1313
# after statement comment
14+
15+
16+
func do_thing() -> void:
17+
if true:
18+
# this is a comment inside of the function block
19+
pass
20+
21+
# this is a comment at the end of the function block
22+
# it should stay inside of this function block
23+
24+
25+
func do_another_thing() -> void:
26+
pass
27+
28+
# likewise, this comment should stay inside of this function block

tests/input/await.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
var normal = await
3+
test()
4+
5+
var negated := not await test()

tests/input/comments_basic.gd

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,17 @@ var a = 10 # inline comment
1111

1212
var b = 10
1313
# after statement comment
14+
15+
func do_thing() -> void:
16+
if true:
17+
# this is a comment inside of the function block
18+
pass
19+
20+
# this is a comment at the end of the function block
21+
# it should stay inside of this function block
22+
23+
24+
func do_another_thing() -> void:
25+
pass
26+
27+
# likewise, this comment should stay inside of this function block

0 commit comments

Comments
 (0)