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

Questionable OpAdd wrapping #371

Open Gama11 opened 5 years ago

Gama11 commented 5 years ago

Input file

class Main {
    static function main() {
        var generatedCodeSlsdjffs = TypeHelper.printFunctionDeclaration(args, ret, context.config.codeGeneration.functions.anonymous) + " ";
    }
}

Broken output

class Main {
    static function main() {
        var generatedCodeSlsdjffs = TypeHelper.printFunctionDeclaration(args, ret, context.config.codeGeneration.functions.anonymous)
            + " ";
    }
}

This is even still > 160 characters long after the wrapping, so it's definitely wrapping at the wrong point.

AlexHaxe commented 5 years ago

yeah, we will have to play with defaults for a bit, to get a good balance... although I think in this case maybe wrapping.callParameter should kick in