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
[NETBEANS-5172] Fix anonymous function formatting #2614
[NETBEANS-5172] Fix anonymous function formatting #2614
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that you have run all tests in your local environment (or repository) because GitHub actions are not available. Thanks!
Yes, I run all tests in "php.editor.indent" package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I don't like this change (yes, I don't use this space in my code) - looking at the number of the changed files in this patch, this will have a big impact; moreover, there was no issue reported for the current behavior so far (it means for the last couple of years), right?
Can we make this configurable? If there was an option for it, I would not be against merging this PR.
Configuration is now bound to PHP > Spaces > Other > After Keywords. By default it will be enabled because it is the way how anonymous functions are formatted in PHP manual - https://www.php.net/manual/en/functions.anonymous.php |
@KacerCZ Great, thank you! |
https://issues.apache.org/jira/browse/NETBEANS-5172 - Enabled and fixed tests for spaces around keyword. - Fixed formatting of anonymous functions. - Updated expected formatting results in rest of tests. Sample code: ```php $lambda = function($param) use($parent) { echo "$param\n"; }; ``` Formatted after fix: ```php $lambda = function ($param) use ($parent) { echo "$param\n"; }; ```
980e813
to
3a8f505
Compare
I added new formatting setting and related tests. |
@KacerCZ Thanks a lot! @junichi11 Feel free to merge it if it is OK for you. Thanks! |
https://issues.apache.org/jira/browse/NETBEANS-5172
Sample code:
Formatted after fix: