codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.89k stars 356 forks source link

Code cleanup change `private protected` to `protected` #860

Open heku opened 2 years ago

heku commented 2 years ago

Environment

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()
    {
    }
}
codecadwallader commented 2 years ago

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

heku commented 2 years ago

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.

hagarpoa commented 2 years ago

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

RichardMelito commented 1 year ago

I can confirm that this is still a problem.

OscarGil-Sage commented 1 year ago

Same here. The issue persists.

AndreiDeacUiPath commented 1 year ago

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.

Banane9 commented 11 months ago

dotnet/roslyn#22406

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