Scony / godot-gdscript-toolkit

Independent set of GDScript tools - parser, linter, formatter, and more
MIT License
944 stars 65 forks source link

Add support for Allman-style `enum` definitions to Godot 4 parsing #270

Closed OoJJBoO closed 5 months ago

OoJJBoO commented 7 months ago

The current parser configuration strictly requires a "{" symbol at the start of an enum body, which causes an error when trying to format Allman-style enum definitions like

enum AnEnum 
{
    VAL_1,
    VAL_2,
}

Since Godot 4 seems to have introduced support for this style (tested using Godot 4.2.1), I would suggest adding this variant to the toolkit's parser as well.

Scony commented 7 months ago

Thanks for raising this. Granted Godot allows that style, I'll definitely need to implement support for that.