HaxeCheckstyle / haxe-formatter

Haxe code formatter based on tokentree
https://haxecheckstyle.github.io/haxe-formatter-docs/#codesamples.CommonSamples.allman_curlies
MIT License
72 stars 16 forks source link

sameLine.functionBody = next does not work when metadata is before the body #681

Open NeeEoo opened 3 months ago

NeeEoo commented 3 months ago

Describe the bug
A clear and concise description of what the bug is.

Input file

class Main {
    public inline function main():Bool
        @:privateAccess return true;
}

Broken output

class Main {
    public inline function main():Bool @:privateAccess return true;
}

Expected output

class Main {
    public inline function main():Bool
        @:privateAccess return true;
}

Optional: hxformat.json

{
  "sameLine": {
    "functionBody": "next"
  }
}