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 removes commented annotations in second lines in C# #923

Open syazdian opened 2 years ago

syazdian commented 2 years ago

Environment

Description

CodeMaid is removing commented Annotation configuration, located after first line, which I need it to be there. This behavior doesn't show up if the annotation is in first line. As you see this comment get's removed because it is not first line:

[Route("api/[controller]")]
[ApiController]
// [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Policy = "cmx")]
public class ServiceFileController : ControllerBaseExt
{ ....

Steps to recreate

  1. Enable Automatic Cleanup on Save
  2. Comment Annotations in Second line
  3. Save the file.
  4. The commented Annotation gets deleted.

Current behavior

I unchecked format cleanup in CodeMaid Options setting: Formatting-->Cleanup-->Run format comments during cleanup but still see the same behavior.

Expected behavior

Don't remove the commented annotation on save after first line.

codecadwallader commented 2 years ago

Thanks for reporting the issue. I am able to reproduce it. This appears to be tied to the same SDK bug from #879. Please check that issue out for more information and a workaround.