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 353 forks source link

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

Open AppFzx opened 1 year ago

AppFzx commented 1 year ago

Environment

<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

codecadwallader commented 1 year ago

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!