Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Code Style - Format multi line function calls with closing paranthesis on a new line
Code Style - Format multi line function calls with closing paranthesis on a new line [message #1760110] Sat, 22 April 2017 19:39
Tobias Wassermann is currently offline Tobias WassermannFriend
Messages: 2
Registered: April 2017
Junior Member
Hi guys,

another code style/code formatter question as I was not able to get a configuration work. For a multiline function call we want to get a format like this:

Other::bar(
            100, 
            200, 
            300, 
            400, 
            500, 
            600, 
            700, 
            800, 
            900
);


So the opening paranthesis should be put directly after the function name, the first argument should be pushed to a new line. The closing paranthesis should not stay on the same line as the last parameter. It must be place on a new line (together with the terminating semicolon) - and the function call should only be wrapped if this is required to the line length limitation, if the code is short than this limit, a function call must not wrapped to multiple lines.

What ever I try I won't get it worked with the PDT formatter, as I can not configure the closing paranthesis to be moved to a new line. So in the best case I will get:

Other::bar(
            100, 
            200, 
            300, 
            400, 
            500, 
            600, 
            700, 
            800, 
            900);


So it seems the PDT is missing here an option for the closing paranthesis stuff. For Java the Eclipse formatter provides an own tab called "Paranthesis" where you can configure if the closing paranthesis of a multi-line function call will be moved to a new line or stay in the same line as the last parameter, I think this solution would be fine here for PDT too, right? Or is there another solution for my problem I just missed?

Thanks,

Tobias
Previous Topic:Code Style - PHPDoc: @param description in same line AND a blank line before the @return-block
Next Topic:Help to the basic setup of PDT
Goto Forum:
  


Current Time: Wed Nov 14 08:53:48 GMT 2018

Powered by FUDForum. Page generated in 0.02652 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top