Formatting
Format GDScript on save with an external formatter.
Formatting is not part of the extension. Zed runs an external formatter that reads GDScript on
stdin and writes the result to stdout. Set it under languages.GDScript.formatter.external and
make sure the command is on PATH.
GDScript Formatter
GDScript Formatter by GDQuest is written in
Rust and uses the same Tree-sitter grammar as this extension. Download a binary from its
releases and name it
gdscript-formatter:
{
"languages": {
"GDScript": {
"formatter": { "external": { "command": "gdscript-formatter", "arguments": [] } }
}
}
}
Add "--use-spaces" to arguments if the project indents with spaces.
gdformat
gdformat comes with GDScript Toolkit
(Python, pip install gdtoolkit):
{
"languages": {
"GDScript": {
"formatter": { "external": { "command": "gdformat", "arguments": ["-"] } }
}
}
}
gdck reimplements GDScript Toolkit in Rust (gdck format,
gdck lint).
Format on save
Set "format_on_save": "on" under languages.GDScript.