Open HugoRoss opened 2 years ago
Thanks for reporting the issue. I am able to reproduce it.
We do have explicit logic to handle this scenario (see https://github.com/codecadwallader/codemaid/blob/dev/CodeMaidShared/Logic/Cleaning/InsertExplicitAccessModifierLogic.cs#L61-L65)
However I think this is being impacted by the known SDK issue with access modifiers. Please see #879 for more information as well as a link to the Roslyn SDK issue.
Environment
Description
When having a partial class over 2 files and in one file the class is defined as' have conflicting accessibility modifiers"
public
and in the other it does not have an accessibility modifier, CodeMaid adds aninternal
modifier, which results in a compile error CS2062 "Partial declarations of 'Steps to recreate
Current behavior
CodeMaid changes the accessibility modifier of the class that is not declaring any accessibility modifiers to
internal
, which is incorrect and leads to a compile error:Expected behavior
CodeMaid should respect the already on any partial class part defined accessibility modifier and use that instead of
internal
:or, as a quick fix, ignore adding accessibility modifiers to partial classes.