If I write multi-line documentation in an XML schema using the properties view it creates <xsd:documentation>
tags to contain it.
Whenever I format the file (CTRL+SHIFT+F) all lines but the first are indented and sometimes wrapped due to this indentation.
This indentation and wrapping effectively ruins every effort of generating a nice looking documentation from the file. Especially if I want to document a table of allowed values.
Before format:
<xsd:documentation>1st line of comment
2nd line is indented and also wrapped as it exceeds the max line length setting.
3rd line is just indented.
</xsd:documentation>
After format:
<xsd:documentation>1st line of comment
2nd line is indented and also wrapped as it exceeds the max line
length setting.
3rd line is just indented.
</xsd:documentation>
The "Format comments" option in Preferences -> XML -> XML files -> Editor does not help with the indentation. Increasing "Line width" on the same preferences page fixes wrapping but I really want the editor to NOT format my the contents of my documentation elements.
You could add an xml atribute xml:space="preserve"
to xsd:documentation
to tell that spaces must be preserved. For example:
<xsd:documentation xml:space="preserve" >1st line of comment
2nd line is indented and also wrapped as it exceeds the max line length setting.
3rd line is just indented.
</xsd:documentation>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With