codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

Code cleanup change `private protected` to `protected`

Open heku opened this issue 4 years ago • 7 comments

Environment

  • Visual Studio version: VS 2019 and VS 2022
  • CodeMaid version: 12.0
  • Code language: C#

Description

Code cleanup change private protected to protected

Steps to recreate

internal class Class1
{
    private protected Class1()
    {
    }
}

After run Cleanup, the private protected access modifier is updated to protected mistakenly.

internal class Class1
{
    protected Class1()
    {
    }
}

heku avatar Nov 09 '21 12:11 heku

Thanks for reporting the issue. I am able to reproduce it as well. It doesn't look like the API we utilize recognizes that access modifier.

https://github.com/dotnet/roslyn/issues/22406

If there was a mapping we would want to extend this list: https://github.com/codecadwallader/codemaid/blob/dev/CodeMaidShared/Helpers/CodeElementHelper.cs#L65

codecadwallader avatar Nov 10 '21 00:11 codecadwallader

Yes, I thought it's a regex issue, but after debugging I found it's the emum doesnt have that value. I have no.idea to fix it, so posted it here.

heku avatar Nov 10 '21 00:11 heku

I'm also experiencing the same problem.

Environment Visual Studio version: VS 2019 CodeMaid version: 12.0 Code language: C# Description Code cleanup change private protected to protected

hagarpoa avatar Nov 28 '21 20:11 hagarpoa

I can confirm that this is still a problem.

RichardMelito avatar Nov 17 '22 15:11 RichardMelito

Same here. The issue persists.

OscarGil-Sage avatar Jun 21 '23 11:06 OscarGil-Sage

This is still an issue , I eneded up disabling tclean up on save when deailing with certain files or going and reverting each cange by hand. Is really frustrating because it breaks the build.

AndreiDeacUiPath avatar Sep 08 '23 12:09 AndreiDeacUiPath

dotnet/roslyn#22406

Just ran into this - they apparently closed the issue and won't implement it :C

Banane9 avatar Oct 21 '23 21:10 Banane9