KacerCZ commented on a change in pull request #2674:
URL: https://github.com/apache/netbeans/pull/2674#discussion_r556822690



##########
File path: 
php/php.editor/src/org/netbeans/modules/php/editor/typinghooks/PhpTypedBreakInterceptor.java
##########
@@ -159,9 +159,14 @@ public void insert(MutableContext context) throws 
BadLocationException {
                         PHPTokenId.PHP_LINE_COMMENT));
                 if (helpToken.id() == PHPTokenId.PHP_TOKEN
                         && (helpToken.text().charAt(0) == ',' || 
helpToken.text().charAt(0) == '(' || helpToken.text().charAt(0) == '[') && 
ts.movePrevious()) {
-                    // only in array declaration we will add new line
+                    // e.g.
+                    // $array = [^];
+                    // $array = array(^);
+                    // function something(^){};
                     if (helpToken.text().charAt(0) == '[') {
                         sb.append("\n"); // NOI18N
+                    } else if (helpToken.text().charAt(0) == '(') {
+                        sb.append("\n"); // NOI18N

Review comment:
       This is handy, because commonly used formatting of multiline arguments 
is 
   
   ```php
   function (
       $param1,
       $param2,
   ): void {
       // function body
   }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to