-
Notifications
You must be signed in to change notification settings - Fork 846
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
Continuation Indentation appears to be doubling the entered value. #7524
Comments
@dustinsilva-acquia
|
Thanks for your time on this. |
Reproducible. Thanks! Please write your example code like the following to the issue body: // This is how my formatter makes it look.
// Continuation Indentation = 4.
$output = Utils::runCommand(
sprintf(
'value %s %s',
$prefix,
$docroot
),
$output
);
// This is how it should look.
$output = Utils::runCommand(
sprintf(
'value %s %s',
$prefix,
$docroot
),
$output
); Please use not |
- apache#7524 - Don't add an indent token when a static method invocation assigns to a variable - Add unit tests Example: ```php $test = Test::staticMethod( test( 'test', $arg1, $arg2 ), $arg ); ``` Before: ```php $test = Test::staticMethod( test( 'test', $arg1, $arg2 ), $arg ); ``` After: ```php $test = Test::staticMethod( test( 'test', $arg1, $arg2 ), $arg ); ```
- apache#7524 - Don't add an indent token when a static method invocation assigns to a variable - Add unit tests Example: ```php // Options: Continuation Indentation = 4 $test = Test::staticMethod( test( 'test', $arg1, $arg2 ), $arg ); ``` Before: ```php $test = Test::staticMethod( test( 'test', $arg1, $arg2 ), $arg ); ``` After: ```php $test = Test::staticMethod( test( 'test', $arg1, $arg2 ), $arg ); ```
@dustinsilva-acquia You can test it with dev build: https://github.com/apache/netbeans/suites/25370046547/artifacts/1643402266 |
…ing-for-static-method-invocation Fix incorrect formatting for a static method invocation [GH-7524]
I did have a few minutes to test this, and it worked in the example I provided, however, when I loaded up a class that had the same code in a method, it would not format it properly--I haven't had time to create a working example, but wanted to share this finding, however brief, in the event it may help you. Thanks for your work on NB! |
Apache NetBeans version
Apache NetBeans 22
What happened
While attempting PSR12 code conformation, I ran into an issue with the following code doubling "continuation indentation" values. Note that "sprintf" has 8 spaces in-front of it, where it should only have 4. My Continuation Indentation is set to 4, and when trying values like 1,2,3, etc. it is very clearly doubling the indentation amount before sprintf, and its closing paren.
Language / Project Type / NetBeans Component
PHP Project
How to reproduce
create a PHP file, copy in the provided code, set "continuation indentation" to 4, press CTRL+SHIFT+F to format, and notice how many spaces sprintf if from the start of $command_output; if it fails as mine does, the spaces will double the value entered for "continuation indentation".
Did this work correctly in an earlier version?
No / Don't know
Operating System
Mac OS X version 14.5 running on x86_64; UTF-8; en_US (nb)
JDK
Java: 22.0.1; OpenJDK 64-Bit Server VM 22.0.1+8
Apache NetBeans packaging
Third-party package
Anything else
Installed from self contained from Codelerity: https://github.com/codelerity/netbeans-installers/releases/download/v22-build1/Apache-NetBeans-22-x86_64.pkg
Note that this also happens on Apache NetBeans version 15 on the same Mac.
Cannot confirm if this happens on other Operating Systems.
Are you willing to submit a pull request?
No
The text was updated successfully, but these errors were encountered: