This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Follow up the https://netbeans.org/bugzilla/show_bug.cgi?id=249199 In #249199 an option "Sort using dependencies" has been introduced. But this does not fulfill my original request [1] EXPECTED: Support ordering of members, but without sorting the fields. [1] https://netbeans.org/bugzilla/show_bug.cgi?id=249199#c15
Created attachment 152936 [details] Proposed patch @Svata: Please review the patch and apply it. See the 3 lines at GeneratorUtils:336. I am not sure, if these changes are enough, but it seems to work for me. See also the screenshot in the next comment
Created attachment 152937 [details] Patch in action
1/ the 'uses dependencies' applies also to visibility sort (perhaps should to all of them); the indent is misleading IMHO. 2/ similar to fields, other coding conventions may disable method ;) or type ordering. Would it be possible to cover all those cases - without eating additional screen estate ?
Created attachment 153085 [details] Arrange settings in IDEA 12 (In reply to Svata Dedic from comment #3) > 1/ the 'uses dependencies' applies also to visibility sort (perhaps should > to all of them); the indent is misleading IMHO. Such an UI change is easy, if you want me to. > 2/ similar to fields, other coding conventions may disable method ;) or type > ordering. > Would it be possible to cover all those cases - without eating additional screen estate ? I guess not. See the options dialog for that in IDEA in the attachment. Everything is configurable, but it is (too) overwhelming. @Svata: So what do you want me to do?
Well; I would not like to add another option 'just' for a special purpose -- the other day some other user will come with a (valid) enhancement that methods (or other stuff) should be excluded from the ordering or grouping ... so if a change is made, it should cover some aspect completely.
(In reply to Svata Dedic from comment #5) > Well; I would not like to add another option 'just' for a special purpose -- > the other day some other user will come with a (valid) enhancement that > methods (or other stuff) should be excluded from the ordering or grouping > ... so if a change is made, it should cover some aspect completely. So there is no chance to get it integrated somehow? Not even by a specific cmdline-switch for netbeans.conf? Or some renaming? IMHO it is better to deliver a feature (even it is imperfect) for users/customers than to wait for a perfect solution, which covers every case, but will delivered in 5 years or never. But Svata, your opinion is also valid.
Svata, I am strongly against the recent addition of "Sort uses dependencies" because disabling it results in Netbeans producing non-compiling code. As far as I'm aware, no one is asking for this functionality and it is harmful to support. Markie wanted an option which would reduce the number of lines that code-format modifies (quoting him: "to keep the diff as small as possible"). So let's either add that option or not, but either way please remove "Sort uses dependencies". Thank you and sorry for the rant :)