codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

Unchecking "Add space inside self closing tags" does not disable adding space in XML .config files

Open AppFzx opened this issue 2 years ago • 1 comments

Environment

  • Visual Studio version: 2022 Pro
  • CodeMaid version: [example 12.0]
  • Code language: XML config file in C# project (app.config)

<bindingRedirect oldVersion="0.0.0.0-1.25.0.0" newVersion="1.25.0.0"/> ...becomes... <bindingRedirect oldVersion="0.0.0.0-1.25.0.0" newVersion="1.25.0.0" /> with space just before closing />

Steps to recreate

Note: this may affect all XML or only a subset. I've only tested it on app.config in a C# project.

  1. Open any app.config in a C# project
  2. Ensure "Add space inside self closing tags" is unchecked
  3. Ensure formatting does NOT include spaces before closing />
  4. Trigger cleanup on file; probably any triggering of cleanup works but I trigger with auto on save... a. Ensure "Automatically run cleanup on file save" is checked b. Save the app.config to trigger cleanup

Current behavior

Unchecking "Add space inside self closing tags" does not disable cleanup adding space in XML .config files

Expected behavior

Unchecking "Add space inside self closing tags" does disable cleanup adding space in XML .config files

AppFzx avatar Mar 02 '23 13:03 AppFzx

Thanks for reporting the issue. The formatting options are related to comment formatting. I believe the option you want is CodeMaid->Options->Cleaning->Insert->Insert blank space before self-closing angle brackets. I was able to reproduce your issue, and confirm it works as expected if I disable that option. Hope it helps!

codecadwallader avatar Mar 28 '23 14:03 codecadwallader