codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

partial class (of a public class) becoms internal

Open robertodalmonte opened this issue 4 years ago • 2 comments

Environment

  • Visual Studio version: [2022 Community]
  • CodeMaid version: [example 12.0]
  • Code language: [example C#]

Description

A partial class (of a public class) becomes internal

Steps to recreate

public partial class JobService : JobManager.JobManagerBase { [...] } partial class JobService { }

Current behavior

internal partial class JobService { }

Expected behavior

partial class JobService { }

robertodalmonte avatar Nov 20 '21 13:11 robertodalmonte

Can confirm. This bug is really annoying; it causes error CS0262 "Partial declarations of 'JobService' have conflicting accessibility modifiers".

CodeMaid should not add an access modifier to a "partial" declaration.

hyperquantum avatar Nov 26 '21 15:11 hyperquantum

Thank you for reporting the issue. I am able to reproduce it as well. There have been a number of issues related to access modifiers with VS2022 due to what appears to be breaking issues near the vsCMAccess API.

As a workaround in the meantime if you disable CodeMaid->Options->Cleaning->Insert->Insert explicit access modifiers on classes this will prevent the issue listed above.

codecadwallader avatar Nov 30 '21 13:11 codecadwallader