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 remove #endif when use [Obsolete] in #if...#endif #895

Closed chechy closed 2 years ago

chechy commented 2 years ago

Environment

Description

when cs code file contains #if NET6_0 [Obsolete] #endif , after save, CodeMaid will remove #endif , this will cause compiler doesnot compile code.

Steps to recreate

any code, when write this

if NET6_0

    [Obsolete]

endif

save this file (auto run CodeMaid),#endif will be removed

Current behavior

Expected behavior

codecadwallader commented 2 years ago

Thanks for reporting the issue. We are aware of it and working on it with Microsoft (bug introduced in latest SDK). See #879 for more details

chechy commented 2 years ago

Thanks, to disable methods can avoid it.