codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

'Clean up Active Document' brakes preprocessor directive #if

Open OrgesKreka opened this issue 2 years ago • 3 comments

Environment

  • Visual Studio version: 2022 Community
  • CodeMaid version: example 12.0
  • Code language: C#

Description

'Clean up Active Document' removes the #endif of the preprocessor directive #if DEBUG

Steps to recreate

  1. Declare the if preprocessor like this: #if DEBUG [AllowAnonymous] #endif
  2. Save file
  3. Clean up the document with codemaid either by CTRL+M+Space or by Click command

Current behavior

The cleanup is removing the #endif part of the preprocessor.

Expected behavior

The preprocessor syntax should not be changed.

OrgesKreka avatar Jul 05 '23 12:07 OrgesKreka

Thanks for reporting the issue. I have been unable to reproduce it. Can you please provide a larger code sample? I'm curious if it's being treated as a part of another element that is adjacent to it.

codecadwallader avatar Jul 22 '23 21:07 codecadwallader

Thanks for the reply @codecadwallader, I am attaching a record of the issue, i tested it in the default project that comes from visual studio, if you want I can share the project with you. IssueReport

OrgesKreka avatar Jul 24 '23 08:07 OrgesKreka

Thanks for the video, that helps. I still wasn't able to reproduce it, but that looks similar to #879 which has some proposed workarounds.

codecadwallader avatar Oct 28 '23 14:10 codecadwallader