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.88k stars 352 forks source link

'Clean up Active Document' brakes preprocessor directive #if #1010

Open OrgesKreka opened 1 year ago

OrgesKreka commented 1 year ago

Environment

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.

codecadwallader commented 11 months ago

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.

OrgesKreka commented 11 months ago

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

codecadwallader commented 8 months ago

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.