sorting code

I have written a little java program for sorting multi-line blocks of
code.  You give at a delimiter to separate the blocks.  It then trims
the blocks and sorts.

You can use it for sorting enums, initialisation lists, case
statements, static init code, Swing component initialisation....  It
runs standalone at present.  You must copy the stuff to be sorted to a
file, and copy it back.  For someone who understood how  plug-ins
work, it should be possible to just highlight some text and sort.  You
would need a way to configure the delimiter.

The source code is posted at
http://mindprod.com/products1.html#SORTCODE
--
Roedy Green Canadian Mind Products http://mindprod.com
Every method you use to prevent or find bugs leaves a residue of subtler
bugs against which those methods are ineffectual.
~ Bruce Beizer  Pesticide Paradox

2 comments

Hello Roedy,

There is plugin "SortSelection" in IntelliJ plugin repository (as a delimiter it always uses linebreak)

0

On Sun, 24 Mar 2013 22:27:53 MSK, Andrey Vokin
<no_reply@jetbrains.com> wrote, quoted or indirectly quoted someone
who said :

>There is plugin "SortSelection" in IntelliJ plugin repository (as a delimiter it always uses linebreak)

I use that, but it can't be used to sort multiline blocks.  I thought
perhaps I could figure out how it works, and replace its innards with
mine. It has no need of a separator parm though.
--
Roedy Green Canadian Mind Products http://mindprod.com
Every method you use to prevent or find bugs leaves a residue of subtler
bugs against which those methods are ineffectual.
~ Bruce Beizer  Pesticide Paradox

0

Please sign in to leave a comment.