Summary
Godot 4.5 has improved the script editing experience but still lacks a built-in code formatter. To unify code style and improve readability, I propose integrating or supporting external GDScript formatters in Godot-IDE.
Candidate solutions (simple comparison)
Want to ask for advice
- Integration method: Which one is more suitable to support first? Or support both and choose for the user?
- Dependencies and Compatibility: Is it possible to call external executables directly? Is it necessary to provide path/parameter configuration in the plugin?
- Experience: Supports automatic formatting when commands/shortcuts/saves, which is more commonly used? Do you need "select area format only" and change preview?
My initial idea (minimal implementation)
- Add the "Format Document" action to the editor.
- The optional formatter and executable file path in the settings provide basic parameters (such as indentation, length).
- Optional "Auto-format when saving" (off by default).
- When an error occurs, a prompt is given without damaging the file content.
Summary
Godot 4.5 has improved the script editing experience but still lacks a built-in code formatter. To unify code style and improve readability, I propose integrating or supporting external GDScript formatters in Godot-IDE.
Candidate solutions (simple comparison)
gdtoolkit(gdformat)
GDQuest's Tree-Sitter Formatter
Want to ask for advice
My initial idea (minimal implementation)