-
Notifications
You must be signed in to change notification settings - Fork 874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PHP] Formatting multiline function arguments is incorrect #6714
Milestone
Comments
Please also write an expected result and an actual result. |
Updated description |
Don't You mean this is the expected? Or am I understanding this incorrectly.. class F {
public array $x = [];
public array $y = [];
public function a() {
return array_merge(
$this->x,
$this->y,
);
}
public function b() {
return array_merge(
$this->nonExistant($anyArgument),
$this->y,
);
}
}
array_merge(
$x,
$y,
); |
I don't see any difference between my expected section and your code block. If it's not clear the issue is in indentation. |
Reproducible. Thanks. |
junichi11
added a commit
to junichi11/netbeans
that referenced
this issue
Dec 24, 2023
…che#6714 - apache#6714 - Consider the TAB size when a column size is got Example: ```php array_merge( $x, $y, ); ``` Before: ```php array_merge( $x, $y, ); ``` After: ```php array_merge( $x, $y, ); ``` - Keep the last anchor to a stack when a method calls are nested Example: ```php nestedCall( something( $arg1, $arg2, C::something( $x, $y, $z, ) ), $y, $z, ); ``` Before: ```php nestedCall( something( $arg1, $arg2, C::something( $x, $y, $z, ) ), $y, $z, ); ``` After: ```php nestedCall( something( $arg1, $arg2, C::something( $x, $y, $z, ) ), $y, $z, ); ``` - Add unit tests
junichi11
added a commit
that referenced
this issue
Dec 24, 2023
…ignment Fix the formatting for the method call arguments alignment option #6714
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apache NetBeans version
Apache NetBeans 20 release candidate
What happened
NetBeans formats multiline function arguments incorrectly:
Actual
Expected
How to reproduce
Use the code attached above and use Source->Format (
alt+shift+F
)Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows 11
JDK
21.0.1
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
I use tabs for indent.
Turning off Formatting -> Alignment -> Multiline Alignment -> Method Call Arguments resolves the issue.
It doesn't work in NetBeans 18 as well, so it's not caused by any recent changes.
Are you willing to submit a pull request?
No
The text was updated successfully, but these errors were encountered: