codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

CodeMaid removes commented annotations in second lines in C#

Open syazdian opened this issue 2 years ago • 1 comments

Environment

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

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.

syazdian avatar May 04 '22 17:05 syazdian

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.

codecadwallader avatar May 10 '22 11:05 codecadwallader