code sorting [Java] [message #1771903] |
Thu, 31 August 2017 20:49 |
N247S - Messages: 2 Registered: August 2017 |
Junior Member |
|
|
Recently I was diving into the posibilities to sort / acces medium to large sized Java files, which made me wonder about a few things.
The main thing(s) I am looking for is/are:
- Grouping of code (by either physical groups, or labels)
- (optional)Hiding/folding/(hyper)linking of specified code groups
- (optional)Sorting of code (by their group id/type, mainly at automatic import/override, or at formatting)
I realize not all of the above is achievable, but I hope I missed something which enables the above features in an easy (and hopefully clean) way.
My research:
1. Regions/sections
This has been (and may still be) a big topic/issue with eclipse. for most IDE's there is support for 'custom code regions'
(One bugzilla report I found dating back to 2004). Unfortunatly this kind of mechanism is still not implemented, besides there also doesn't seem to be any plugins anymore which provides this (coffee-bytes has been gone for quit a while now).
The last comment on the bugzilla report I mentioned is from 2011, so I was curious if there is any intention (by the eclipse/jdt developers, or by any plugin developers) to provide this mechanism for any of the newer (and future) versions of eclipse?
2. @Category
Now I know about the @Category documentation tag in eclipse. It enables grouping in some way, though its quit timeconsuming (e.g. adding documentation & tags to every single element), and besides its not really desinged to be used as such. It doesn't enable hiding/folding or sorting. Also its rather anoying that overriden methods don't inherit their parent category labels, which makes sence if its used as implementation specific labels, and not as method specific labels (which is what I am looking for).
3. Dirty workarounds
A commonly used 'dirty-workaround' is the use of a dummy method. when placed at the right place it can function as region/section header, separator and as region/section anchor. The down side (besides being 'dirty') is that it doesn't allow hiding/folding, although its IDE independent (which is usually not the case with other IDE code regions/sections support).
If anyone has any suggestions, or idea's I would love to hear them.
Thanks for your time!
|
|
|
Powered by
FUDForum. Page generated in 0.03286 seconds