Bug 574701

Summary: XML Formatter option equivalent of Java Formatter "Control the formatting in code sections"
Product: [Eclipse Project] Platform Reporter: Marco Descher <marco>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: 4.21   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Marco Descher CLA 2021-07-07 02:41:06 EDT
[[NOT SURE if this is right Product/Component - PLEASE correct]]

The option to disable code formatting in Java files (as documented in http://archive.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/eclipse-news-part2.html#JavaFormatter) should have an equivalent with XML files.

See e.g. https://stackoverflow.com/questions/6778795/selectively-turning-off-eclipse-formatting-of-xml-files for a discussion.

For example, the following xml entry (within a bigger xml) should deactivate formatter for the line's content:

<!-- @formatter:off -->
<additionalArgs>-artifactRepository file:${project.basedir}/target/${target-name}/maven-p2 -metadataRepository file:${project.basedir}/target/${target-name}/maven-p2</additionalArgs>
<!-- @formatter:on -->

That is, the value of the entry should keep its formatting, while the key could be included in the formatting in so far,
as that it gets the correct indentation.

Up to the moment, every time I format the XML i have to jump to these entries to manually fix them.