codemaid
codemaid copied to clipboard
Type-only primary ordering
Environment
- Visual Studio version: 2017 Enterprise
- CodeMaid version: 10.5
- Code language: C#
Description
I'd like a simple "Type" choice for primary ordering. I don't care to put all the public properties separate from the private ones from the protected ones. I'd like to simply sort all of the properties alphabetically, then all the methods, classes, etc. It is not uncommon over the course of a software project for a property that started off private to later on change to protected or even public.
My primary use case for automatic sorting on multi-developer projects is to reduce merge collisions and simplify pull requests by eliminating "noise". If changing an access keyword magically "teleports" my property/method to a different place in the file after sorting, then I have to manually figure out what changed, and the side-by-side view isn't going to help me at all in that case.
Steps to recreate
- Sort any class with properties and methods with varying visibility.
Current behavior
I can only choose between "type then access" or "access then type"
Expected behavior
I'd like a "type" choice that ignores access when sorting so that members sort into larger groups by name. If "type" were selected, then the "Access levels should be ordered by" should be greyed out and ignored.
Alternately, the "Access levels should be ordered by" could be given a "none" option that would accomplish the same goal.
Makes sense, thanks for the suggestion!
Oh, also, any time a property gets "teleported" this way, my Git history gets ruined because now it looks like I'm the one that wrote the code in question. Part of my use case for wanting a tool like CodeMaid is to make sure everyone's code gets organized the same way automatically. Git's "blame" tool is far more useful this way because all the check-ins should be organized and formatted consistently. When I need to ask a question about a piece of code, Git can reliably tell me who really wrote it, not just who touched it last.
Piling on. This feature would be very useful for working on https://github.com/dotnet/ repos, since many of those originated from .NET Framework source code, which followed "alphabetised, ignore access modifiers" order.