[clang-format] BinPack and all arguments on next line.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[clang-format] BinPack and all arguments on next line.

Alex Denisov via cfe-dev
Hello, I will be working on a patch to add a feature I need in my code formatting. Before putting in the time, I'd like to make sure the idea is welcomed and/or someone isn't already working on the same. Maybe the feature already exists and I haven't found how to turn it on.

With BinPackArguments true, when a multiline call is parsed, a break will be added after the left paren if clang-format can fit everything in a single line. I wish to add an option to stop this behaviour.

Ex :
        do_something(loooooooooooooooooooooooooooooooooooooooooooooooooooong, message);

current results :
        do_something(
                        loooooooooooooooooooooooooooooooooooooooooooooooooooong, message);

desired results :
        do_something(loooooooooooooooooooooooooooooooooooooooooooooooooooong,
                        message);

I am not sure if that is what AllowAllParametersOfDeclarationOnNextLine: false is supposed to do for declarations (it doesn't work here). If it is, then I'd like to fix that option and add a new AllowAllArgumentsOnNextLine option. If it isn't (broken), then I'll figure some other name and also add an equivalent option to parameters.

Good day
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev