Feature Request: Option to ignore static modifier when sorting members
Summary
Add an option to ignore the static modifier when sorting type members (methods, fields, properties, etc.), so that static and non-static members of the same visibility are sorted together alphabetically instead of being split into separate groups.
Current behavior
Currently, CodeMaid treats static members as a separate group from non-static members of the same visibility level. For example, with the default configuration, public static methods are placed before public instance methods:
// Result with current CodeMaid behavior
public class MyService
{
public static void DoSomethingStatic() { ... } // public static
public static void ProcessStatic() { ... } // public static
public void DoSomething() { ... } // public instance
public void Process() { ... } // public instance
}
The same split happens across all visibility levels (private static vs private, protected static vs protected, etc.).
Desired behavior
With the proposed option enabled, static and non-static members of the same visibility would be sorted together alphabetically, regardless of whether they are static or not:
// Result with the proposed option enabled
public class MyService
{
public void DoSomething() { ... } // alphabetical: D
public static void DoSomethingStatic() { ... } // alphabetical: D
public void Process() { ... } // alphabetical: P
public static void ProcessStatic() { ... } // alphabetical: P
}
Proposed option
This could be implemented as a checkbox in the Reorganize settings, something like:
☐ Group static members separately from instance members
When unchecked, the static modifier would be ignored for grouping purposes, and members would be sorted purely by visibility and then alphabetically.
Scope
Ideally this option would apply uniformly to all member types, not just methods — including:
- Methods
- Fields
- Properties
- Events
- Constructors (where applicable)
Motivation
In some codebases and style guides, there is no preference for grouping static and instance members separately — they are simply kept in alphabetical order within each visibility level. Forcing a static/instance split can make it harder to locate members at a glance when the reader's mental model is purely alphabetical.
Environment
- CodeMaid version: 12.0.300
- Visual Studio version: Visual Studio 2022 (17.14.29)
- Language: C#
Feature Request: Option to ignore
staticmodifier when sorting membersSummary
Add an option to ignore the
staticmodifier when sorting type members (methods, fields, properties, etc.), so that static and non-static members of the same visibility are sorted together alphabetically instead of being split into separate groups.Current behavior
Currently, CodeMaid treats static members as a separate group from non-static members of the same visibility level. For example, with the default configuration, public static methods are placed before public instance methods:
The same split happens across all visibility levels (
private staticvsprivate,protected staticvsprotected, etc.).Desired behavior
With the proposed option enabled, static and non-static members of the same visibility would be sorted together alphabetically, regardless of whether they are static or not:
Proposed option
This could be implemented as a checkbox in the Reorganize settings, something like:
When unchecked, the
staticmodifier would be ignored for grouping purposes, and members would be sorted purely by visibility and then alphabetically.Scope
Ideally this option would apply uniformly to all member types, not just methods — including:
Motivation
In some codebases and style guides, there is no preference for grouping static and instance members separately — they are simply kept in alphabetical order within each visibility level. Forcing a static/instance split can make it harder to locate members at a glance when the reader's mental model is purely alphabetical.
Environment