codemaid
codemaid copied to clipboard
Unchecking "Add space inside self closing tags" does not disable adding space in XML .config files
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.
- Open any app.config in a C# project
- Ensure "Add space inside self closing tags" is unchecked
- Ensure formatting does NOT include spaces before closing
/> - 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
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!