codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

Attributes Sorting

Open ghost opened this issue 1 year ago • 1 comments

Environment

  • Visual Studio version: 2022 Community
  • CodeMaid version: 12.0
  • Code language: C#

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)]

ghost avatar Mar 10 '23 20:03 ghost

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

codecadwallader avatar Mar 28 '23 14:03 codecadwallader