A VS Code extension for GDScript that aligns comments in Go-style after formatting, keeping your code clean and readable.
Features
One-click format & align — Formats the document and aligns # comments to a consistent column position
Smart grouping — Detects consecutive comment blocks and aligns them within the same group
Configurable indent — Customize the spacing before # symbols via settings
Non-destructive — Only modifies comment positioning, never touches your code logic
Before
var speed = 10.0 # movement speed
var position = Vector2.ZERO # current position
var health = 100 # player health
var max_health = 100 # maximum health
After
var speed = 10.0 # movement speed
var position = Vector2.ZERO # current position
var health = 100 # player health
var max_health = 100 # maximum health
Requirements
VS Code 1.75.0 or higher
GDScript language support (built-in with Godot extensions)
Usage
Open any .gd file
Press Shift+Alt+F (or run command Godot: Format Document with Comment Align from Command Palette)
Comments will be automatically aligned after formatting
How it works
Format — First runs the built-in GDScript formatter
Align — Then scans the document for comment blocks and aligns # symbols within each consecutive group
Extension Settings
This extension contributes the following setting:
Setting
Default
Description
godotCommentAlign.commentIndentSize
4
Number of tabs or spaces before the # symbol in comments (range: 1-99)
Keybindings
Key
Context
Shift+Alt+F
When editing a GDScript file (editorLangId == gdscript)