BowlerHatLLC / vscode-as3mxml

ActionScript & MXML language extension for Visual Studio Code. Develop apps for Adobe AIR, Adobe Flash Player, or Apache Royale.
https://as3mxml.com/
Apache License 2.0
257 stars 39 forks source link

asformat: Indentation issues with nested mixed blocks #613

Closed esidegallery closed 1 year ago

esidegallery commented 2 years ago

Confirmed in a fresh installation of the latest VSCode with the ActionScript & MXML extension on Windows 10 x64.

Nested object & function blocks and their opening & closing braces are incorrectly indented:

ASFormat Indentation

joshtynjala commented 2 years ago

Copying the original code below for easy copy/paste if I need to reference it again in the future:

public class Test extends EventDispatcher
{
    public function Test()
    {
        var alert:Alert = Alert.show(
            "Are you sure?",
            "Close",
            new ArrayCollection([
                {
                    label: "Save",
                    triggered: function():void
                    {
                        dispatchEventWith("save");
                    }
                },
                {
                    label: "Discard",
                    triggered: function():void
                    {
                        dispatchEventWith("discard");
                    }
                }
            ]));
    }
}
joshtynjala commented 2 years ago

apache/royale-compiler@b495634efff9c9d862e7205295abdceb8f3e69cf