codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

Cleanup removes "fixed" keyword

Open FStapenhorst opened this issue 3 years ago • 3 comments

Environment

  • Visual Studio version:2022 Professional 17.0.0.
  • CodeMaid version: 12.0
  • Code language: C#

Description

When cleaning this block

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 8)]
    public unsafe struct USER_PROPERTIES
    {
        public BOOL anonymerBenutzer;
        public BOOL managerBerechtigung;
        public BOOL kannPasswortNichtAendern;
        public BOOL mussPasswortAendern;
        public BOOL auswahlMitPfadAngabe;
        public BOOL netzAnmeldung;
        public BOOL netzNameIdentisch;
        public BOOL darfVertreterWaehlen;
        public fixed byte fullName[64];
        public fixed byte netzName[64];
    }
[CodeMaid.config.zip](https://github.com/codecadwallader/codemaid/files/7557142/CodeMaid.config.zip)

the keyword "fixed" is removed which results in compilation error.

See settings attached.

FStapenhorst avatar Nov 17 '21 18:11 FStapenhorst

Thanks for reporting the issue. I am able to reproduce it. It seems to be caused by the setting at CodeMaid->Options->Cleaning->Insert->Insert explicit access modifiers on fields. There are other similar bug reports where trying to check the access modifier is causing a side effect in VS2022's APIs. As a workaround you could disable this option for the time being.

codecadwallader avatar Nov 19 '21 13:11 codecadwallader

Ran into the same problem in VS22 today.

thoros1179 avatar Jul 11 '22 10:07 thoros1179

Similarly, it's removing readonly on properties.

bitbound avatar Oct 21 '23 17:10 bitbound