codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

option to have the space (<see cref="" />) or not have the space (<see cref=""/>) before the closing />

Open karolsykora opened this issue 4 years ago • 3 comments

Environment

  • Visual Studio version: 2019 16.11.9
  • CodeMaid version: 12.0
  • Code language: XML (e.g. config file)

Description

Is there a config option where I can set the formatting feature to include or not include the space before the closing /> XML tag? This is causing lot of unnecessary code changes during the code review.

Steps to recreate

Currently I'm always having <see cref="" /> XML tags with space before the />. I would like to have the possibility to remove the space as follows: <see cref=""/>.

Current behavior

XML tag containing the space: <see cref="" />

Expected behavior

make it configurable to have XML tag not containing the space: <see cref=""/> or containing the space: <see cref="" />

karolsykora avatar Jan 12 '22 10:01 karolsykora

Thanks for asking the question. There is an option called "Add space inside self closing tags" under CodeMaid->Options->Formatting. Is that what you were looking to find?

codecadwallader avatar Feb 06 '22 18:02 codecadwallader

yes, this is exactly what I wanted, but unfortunately it's not working 100% properly. I have web.config file, where is <appSettings> <add key="aaa" value="bbb" /> </appSettings> and if the config switch you mentioned "Add space inside self closing tags" is ON, it's working fine, it's adding the space. But when the config switch if OFF, it's not working properly - if there is no space, it's added (this behavior is wrong, this should happen only when the config switch is ON) and if there is a space, it isn't removed, it's always there. What I'm missing is a way how to remove the space. Thanks.

karolsykora avatar Feb 08 '22 10:02 karolsykora

What I'm missing is a way how to remove the space.

Gotcha. I don't think it currently supports removing the space, only inserting it.

codecadwallader avatar Feb 17 '22 12:02 codecadwallader