Possible Duplicate:
Sort selected text from Visual Studio context menu
I have some lines of code I wish to sort alphabetically, nothing clever.
I wish to just select the lines, and then sort them. (I could copy them into Excel then sort and copy them back, but there must be a better way)
This is the bit of code I am trying to time, in real life it is a lot longer…
sortingColumnOverrides: new Dictionary<Enum, Enum>() { {Cols.SimulationPrice,Cols.SimulationPriceRange}, {Cols.BaselineEffectivePrice, Cols.BaselineEffectivePriceRange}, {Cols.SimulationEffectivePrice, Cols.SimulationEffectivePriceRange}, {Cols.SimulationCost, Cols.SimulationCostRange}, {Cols.BaselinePrice,Cols.BaselinePriceRange}, {Cols.BaselineCost,Cols.BaselineCostRange}, {Cols.PriceLiftAbs, Cols.SimulationPriceChangeRange}, {Cols.PriceLiftPct, Cols.SimulationPriceChangePercentRange}, {Cols.BaselinePricePerUOM, Cols.BaselinePricePerUOMRange}, {Cols.SimulationPricePerUOM, Cols.SimulationPricePerUOMRange}, //lots more lines like these.... }
More marks, if there is a easy way to stop the sort at the first ",", but that would just be icing on the cake.
(Other questions in the past of ask about the more complex task of sorting methods by name etc.)
Select my lines of text. Press F9. Keep your eyes on the code, you'll see a change. And now it's in alphabetical order.
You have an add-on for this: http://visualstudiogallery.msdn.microsoft.com/D6678A1F-C700-4532-8C5E-A799D875063D?SRC=VSIDE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With