icsharpcode/NRefactory — pull request #122 by Uriel6575 (2012-09-27 18:22:52+00:00)
Title: Sort usings code action

The basic stuff seems to work fine and is covered by tests though I have a couple of questions related to functionality and implementation.
1. Should this action work separately on usings at the begining of file and usings inside namespace declarations? So if I'd sort usings inside one namespace, all the others will remain untouched. Anyway, remove redundant usings action removes usings from any location so I've implemented sorting the same way.
2. Should namespaces from imported assemblies preceed those from the solution? For example, in tests should it be "NUnit, ICSharpCode" or "ICSharpCode, NUnit"?
3. Why remove redundant usings action is available when cursor is at the end of line with using declaration but "context.GetNode()" returns null in the same situation?
4. How to remove empty lines using the script object? Now my implementation just replaces nodes in the right order but I'd like to remove empty lines between them, because they may loose their meaning after reordering.
5. What's better way to add compound action "Sort and remove usings"?

Thanks!