Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
This plugin allow you to inserts and updates GDScript documentation comment templates directly from the native script editor context menu.You can support us from itch.io:https://quanty-bandit.itch.io/gdscript-commenter-plugin
GDScript Commenter β Godot 4 Plugin
A Godot 4 editor plugin that inserts and updates GDScript documentation comment templates directly from the native script editor context menu.
Place the cursor anywhere inside or on a declaration, right-click, and choose Insert Comment (or Update Comment if one already exists). The plugin detects the declaration type automatically and generates the correct ## docstring β including parameter names, types, return type, enum members, and class name β all in Godot BBCode format ready for the built-in documentation viewer.
β¨ Features
- Keyboard shortcut β press Shift+F1 anywhere in the script editor to insert or update a comment instantly, without opening the context menu
- Single smart menu entry β one action covers all declaration types
- Auto-detection from cursor line β identifies
func,var/const/@export/@onready,enum, class header (@tool/class_name/extends), or falls back to a plain line comment - Multi-line block support β if the cursor is inside a
funcorenumbody, the plugin walks upward to find the opening keyword; multi-line signatures (parameters or braces spread across lines) are fully parsed - Insert or Update β the label shows
Insert CommentorUpdate Commentwith the detected type in brackets, so you always know what will happen before clicking - Smart merge on update β existing description texts are preserved; parameters are added, removed, or kept in sync with the current signature; the return description is kept only when the return type is unchanged; enum members follow the same rules
- Real class name β uses the
class_namedeclaration when present, falls back to the filename in PascalCase - Section separator β a second entry inserts a visual
# ---divider with a placeholder title - Godot BBCode β output uses
[param],[return],[br],[b],[code],[codeblock]for full compatibility with the Godot documentation viewer
π¦ Installation
- Copy the
addons/gdscript_commenter/folder into your project'saddons/directory. - Open Project β Project Settings β Plugins.
- Enable GDScript Commenter.
π Usage
- Open any
.gdfile in the script editor. - Place the cursor on the declaration line, or anywhere inside a
funcorenumbody. - Press Shift+F1 β or right-click and choose Insert Comment / Update Comment from the GDScript Commenter section.
The label in the context menu shows the detected type and the keyboard shortcut before you click:
βββ GDScript Commenter ββββββββββββββββββββββ
Insert Comment [func] Shift+F1
Insert Section Separator
π Output examples
func
## calculate_damage.
##
## [br]Description: TODO
##
## [br][param attacker]: (Node) TODO
## [br][param weapon]: (Item) TODO
## [br][param multiplier]: (float) TODO
##
## [br][return] (int): TODO
func calculate_damage(attacker: Node, weapon: Item, multiplier: float = 1.0) -> int:
Multi-line signatures are fully supported:
func calculate_damage(
attacker: Node,
weapon: Item,
multiplier: float = 1.0
) -> int:
var / const / @export / @onready
## speed_multiplier.
##
## [br]Exported variable β TODO: description.
## [br]Type: [float]
## [br]Default: [code]1.0[/code]
@export var speed_multiplier: float = 1.0
enum
## Toto.
##
## [br]Description: TODO
##
## [br]Members:
## [br]- [b]a[/b]: TODO
## [br]- [b]b[/b]: TODO
## [br]- [b]c[/b]: TODO
enum Toto { a, b, c }
Enum members follow the exact casing from the code. Multi-line enums and single-line enum Name { ... } are both handled.
class header
First insertion β the class name is read from class_name and injected automatically:
## PlayerController.
##
## [br]Description: TODO
##
## [br]Usage:
## [codeblock]
## var obj = PlayerController.new()
## [/codeblock]
@tool
class_name PlayerController
extends CharacterBody2D
After filling in the description and running Update Comment:
## PlayerController.
##
## [br]Description: Manages player movement, input, and health.
##
## [br]Usage:
## [codeblock]
## var obj = PlayerController.new()
## [/codeblock]
@tool
class_name PlayerController
extends CharacterBody2D
Filename fallback β when no class_name is declared, the filename is converted to PascalCase:
## AudioSpectrumViewer.
##
## [br]Description: TODO
##
## [br]Usage:
## [codeblock]
## var obj = AudioSpectrumViewer.new()
## [/codeblock]
# file: audio_spectrum_viewer.gd (no class_name declaration)
extends Control
The comment is always inserted above the header block (@tool, class_name, extends). On update, the class name is resynchronised automatically β useful after renaming the class.
line comment (fallback)
# TODO: describe what this line does
some_unrecognised_line()
section separator
# ---------------------------------------------------------------------------
# SECTION NAME
# ---------------------------------------------------------------------------
π Update / merge rules
When a docstring already exists above a declaration, the plugin rebuilds it from the current signature and re-injects the text you previously wrote:
| Element | Behaviour |
|---|---|
| Description | Existing text is always preserved |
[param] |
Kept with its description if the parameter still exists; dropped if removed; added as TODO if new |
[return] |
Description preserved only when the return type is unchanged; reset to TODO if the type changed |
| Enum members | Same rules as [param] β kept, dropped, or added as the enum body changes |
| Variable description | Existing text is preserved |
| Class name | Always updated to the current class_name or filename β useful after renaming |
| Line comment | If a comment already exists above the line, nothing is done |
βοΈ Compatibility
- Godot Engine 4.x (tested on 4.2+)
- GDScript files only
π Licence
MIT β free to use, modify and distribute.
This plugin allow you to inserts and updates GDScript documentation comment templates directly from the native script editor context menu.
You can support us from itch.io:
https://quanty-bandit.itch.io/gdscript-commenter-plugin
Reviews
Quick Information
This plugin allow you to inserts and updates GDScript documentation comment templates directly from the native script editor context menu.You can support us from itch.io:https://quanty-bandit.itch.io/gdscript-commenter-plugin