You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Put in PSR-12 order" option is used to make sure use groups (types, functions, constants) are in the correct order as required by the standard. However, the order is changed even if the option is disabled when using "Fix Imports". It probably shouldn't assume any order by default.
Also, "Put in PSR-12 order" only seems to affect "Fix Imports" and not using "Source > Format".
How to reproduce
Disable 'Put in PSR-12 order' and use 'Fix imports' with the following code:
Okay, you're right about the default order for adding use groups, but it just feels unexpected if the order of something that's already there changes suddenly. If you don't notice and fix it, then you'll have to go back and fix your commits.
I guess ideally new imports should be added in a correct order but at the same time not to make other changes to imports. But I'm not sure how achieve that in a way that wouldn't be complicated.
junichi11
added a commit
to junichi11/netbeans
that referenced
this issue
Aug 7, 2023
Apache NetBeans version
Apache NetBeans 19 release candidate 3
What happened
"Put in PSR-12 order" option is used to make sure use groups (types, functions, constants) are in the correct order as required by the standard. However, the order is changed even if the option is disabled when using "Fix Imports". It probably shouldn't assume any order by default.
Also, "Put in PSR-12 order" only seems to affect "Fix Imports" and not using "Source > Format".
How to reproduce
Disable 'Put in PSR-12 order' and use 'Fix imports' with the following code:
Expected result:
Actual result:
Did this work correctly in an earlier version?
No
Operating System
Windows 10
JDK
18.0.2.1; OpenJDK 64-Bit Server VM 18.0.2.1+1-1
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
Low priority issue.
Are you willing to submit a pull request?
No
The text was updated successfully, but these errors were encountered: