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.92k stars 362 forks source link

Cleanup removes "fixed" keyword #874

Open FStapenhorst opened 2 years ago

FStapenhorst commented 2 years ago

Environment

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.

codecadwallader commented 2 years ago

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.

thoros1179 commented 2 years ago

Ran into the same problem in VS22 today.

bitbound commented 1 year ago

Similarly, it's removing readonly on properties.