godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.16k stars 21.19k forks source link

GDScript enum/dict/array closing brace auto-indentation does not match official style guide #86241

Open muno777 opened 10 months ago

muno777 commented 10 months ago

Tested versions

Found in v4.2.stable.official [46dc27791]

System information

Godot v4.2.stable - Windows 10.0.22621

Issue description

In the official GDScript style guide, the closing braces for arrays, dictionaries, and enums are not indented:

image

However, the auto-indent in the editor doesn't follow this:

image

I'm not sure if this strictly counts as a "bug", but it is a gap in the current auto-indent behavior.

Steps to reproduce

Open a new GDScript file and create an enum (with auto-indentation enabled):

enum indentation

Minimal reproduction project (MRP)

N/A

Calinou commented 10 months ago

I can confirm this on 4.2.stable, both with enum and var creating a Dictionary.

The behavior in VS Code is to deindent when entering }, so I think it makes sense to match that behavior as well.