junichi11 commented on a change in pull request #2674:
URL: https://github.com/apache/netbeans/pull/2674#discussion_r556220361
##########
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:
I think the users prefer to add a new line if there is no parameter. So,
I've changed the behavior.
```php
// there is no parameter
// ^: caret position
class Example {
public function __contruct(^){}
}
// before: don't add the new line
class Example {
public function __contruct(
^){}
}
// after: add the new line
class Example {
public function __contruct(
^
){}
}
```
----------------------------------------------------------------
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