Environment
- Visual Studio version: Community Version 17.1.0 Preview 1.1
- CodeMaid version: 12.0.300
- Code language: C#
Description
I wrote this code:
namespace CodeMaidBugRepro
{
public class Class1
{
#if DEBUG
[Obsolete]
#endif
public uint A(uint b) => b;
}
}
After running the code cleanup with CodeMaid, the #endif gets removed, making build impossible.
Steps to recreate
- Create a class library project.
- Write a method.
- Add
[Obsolete] on top of the method. [DebuggerStepThrough] also gets affected.
- Surround the attribute with
#if and #endif.
- Click on "Clean Up Active Documents" or turn on "Automatic Cleanup On Save" and save the document.
Current behavior
The #endif gets removed.
Expected behavior
The #endif should remain alive.
Environment
Description
I wrote this code:
After running the code cleanup with CodeMaid, the
#endifgets removed, making build impossible.Steps to recreate
[Obsolete]on top of the method.[DebuggerStepThrough]also gets affected.#ifand#endif.Current behavior
The
#endifgets removed.Expected behavior
The
#endifshould remain alive.