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

CodeMaid inserts excplicit private access modifier for partial methods #933

Open Risord opened 2 years ago

Risord commented 2 years ago

Environment

Description

CodeMaid inserts excplicit "private" access modifier for partial methods.

namespace ExampleNamespace
{
    public partial class ExampleClass
    {
        partial void ExampleMethod();
    }
}

Current behavior

Private access modifier is added to method which is not valid C# code and won't compile.

namespace ExampleNamespace
{
    public partial class ExampleClass
    {
        private partial void ExampleMethod();
    }
}

Expected behavior

namespace ExampleNamespace
{
    public partial class ExampleClass
    {
        partial void ExampleMethod();
    }
}
codecadwallader commented 2 years ago

Thank you for reporting the issue. I believe this is related to an underlying SDK issue introduced in VS2022. There are some more details in #879 and a link over to the Roslyn SDK issue. The recommended workaround at this time is to disable the CodeMaid options that insert explicit access modifiers.

Yukihana commented 4 months ago

Is it possible to temporarily add an option to disable adding modifiers for partial methods? Turning it off completely simply because of partials, feels like a waste imho