Closed zedzee37 closed 3 months ago
I should note that I have 'hard tabs' enabled for GDScript, simply to follow Godot's usage of tabs instead of spaces, but the same issue occurs when using spaces (and enabling spaces on the Godot side).
Reopening because the attempted fix did not fully fix the issue. I reverted it for now.
I tried adding a generic query to target blocks on Python's model but couldn't get it working even if the query would compile, unfortunately. GDScript's parser doesn't have the notion of blocks in its grammar so I'm not sure how to capture them for indentation purposes.
Here are issues that I can spot right now:
Found the cause and a fix, Zed has some settings that don't seem to be documented that we kinda need to use for an indent-based language. I couldn't get indentation working great with tree sitter queries, but they're working well with these settings now.
Tested Versions
System Information
Ubuntu 24.04 LTS
Issue Description
When using this extension, the indentation of the code is often lost, specifically with for loops or if statements, where it just goes to the start of the line or the indentation level of the function.
Steps to Reproduce
Writing code such as:
and creating a new line results in the indentation level being lost.