-
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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)
- Advantages: old-fashioned tools, stability, easy installation of pip, uniform style.
- Disadvantages: Python dependency, high integration cost; slow update, occasional syntax corner issues; few configuration items.
-
GDQuest's Tree-Sitter Formatter
- Advantages: Rust implementation, fast; support for organizing according to the official style, with indentation; multi-platform binary, low integration threshold; active projects.
- Weaknesses: Still being refined, some syntax omissions; custom rules require knowledge of Tree/Sitter queries.
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.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request