Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REQUEST: Add ability to keep Async members immediately following corresponding non-Async members when using default sorting in "Sort Members" #6

Open
flmbray opened this issue Jul 3, 2023 · 1 comment

Comments

@flmbray
Copy link

flmbray commented Jul 3, 2023

In the "Sort Members", when using the "Sort" button, method members that end in "Async" are all sorted lexicographically, thus separating them from their corresponding non-async partners when there are multiple overrides of a particular method. For example, this would be the result of sorting 4 methods where there are two non-async overloads and two partner async overloads:

Method(int value)
Method(long value)
MethodAsync(int value)
MethodAsync(long value)

It would be useful to provide an option (as a checkbox, without having to manually drag them) to change this behavior to keep the async methods together with their partners, like this:

Method(int value)
MethodAsync(int value)
Method(long value)
MethodAsync(long value)

@menees
Copy link
Owner

menees commented Jul 20, 2023

I like this idea. It'll take some work to implement it though, so I'm going to leave this issue open until I can get to it (which may be a while as I'm busy on other projects).

The "Sort Members" command already supports a configurable sort order (under Tools > Options > Menees VS Tools > Sort : Sort Members order). Its default sort order is Kind, Access, IsStatic, KindModifier, ConstModifier, OverrideModifier, Name, ParameterCount. This can be seen in code at Sort/MemberSorter.cs#L30.

To implement this issue, I'll have to split Name into NamePrefix and NameSuffix, and I'll have to add support for ParameterText instead of just ParameterCount.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants