GDQuest / zed-gdscript

Zed support for the GDScript language
MIT License
38 stars 10 forks source link

After the beginning of a code block, the next line is not indented #21

Closed NathanLovato closed 3 months ago

NathanLovato commented 3 months ago

Here's a video demonstrating this:

https://github.com/user-attachments/assets/ffc6584e-c918-40fc-97e0-199db626d91f

fstxz commented 3 months ago

Isn't this the same as #10 ? It was supposed to be fixed in #15

NathanLovato commented 3 months ago

It seems to be the same thing, in which case the pull request did not fix the issue. It might have been tested a little too quickly, not finding all edge cases. I don't see how the Python implementation works or would provide full indent support. I'm just learning tree sitter queries, but this code, to my understanding, only supports brackets:

(_ "[" "]" @end) @indent
(_ "{" "}" @end) @indent
(_ "(" ")" @end) @indent

What I understand from it is "indent anytime you encounter a closed pair of square, angular brackets, or parentheses, after anything. If this is correct, these rules, it'd be normal that no indent gets added after starting a block: there'd be no rule for that.

fstxz commented 3 months ago

I reverted that PR and indentation seem to work only when there is no : at the end of the line, interesting.