codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.88k stars 353 forks source link

Attributes Sorting #987

Open ghost opened 1 year ago

ghost commented 1 year ago

Environment

Description

Allow having the option of being able to sort attributes by default alphabetically and perhaps offer other types of sorting methods.

Expected behavior

Once Cleanup Active Document or Reorganize Active Document has been clicked the attributes for the code has been sorted alphabetically. There could also be different types of sorting methods that could be configured in the settings.

Before:

[ToolboxItem(true)]
[ComVisible(true)]
[ToolboxBitmap(typeof(Foo), "Foo.bmp")]
[Designer(typeof(FooDesigner))]
[Description("The Foo")]
[ClassInterface(ClassInterfaceType.AutoDispatch)]
[DefaultEvent("FooChanged")]
[DefaultProperty("Value")]

After:

[ClassInterface(ClassInterfaceType.AutoDispatch)]
[ComVisible(true)]
[DefaultEvent("FooChanged")]
[DefaultProperty("Value")]
[Description("The Foo")]
[Designer(typeof(FooDesigner))]
[ToolboxBitmap(typeof(Foo), "Foo.bmp")]
[ToolboxItem(true)]
codecadwallader commented 1 year ago

Thanks for the suggestion! We do have a sort lines feature, but it is not automatically tied into cleanup currently.