godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.48k stars 148 forks source link

Add #region code folding #566

Closed jsbeckr closed 6 months ago

jsbeckr commented 6 months ago

Godot version

4.x

VS Code version

1.85.1

Godot Tools VS Code extension version

Master

System information

MacOS

Problem statement

GDscript added code regions a while ago https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_basics.html#code-regions

You can create regions by using a special comment #region SomeName ... #endregion. It would be nice vor VS Code to understand these statements.

Proposed solution

Implement code folding by implementing a custom FoldingRangeProvider

https://code.visualstudio.com/api/references/vscode-api#FoldingRangeProvider

jsbeckr commented 6 months ago

I don't know why I didn't see the code folding arrows yesterday. 😓 It's already implemented.