Bug 574701 - XML Formatter option equivalent of Java Formatter "Control the formatting in code sections"
Summary: XML Formatter option equivalent of Java Formatter "Control the formatting in ...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.21   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-07 02:41 EDT by Marco Descher CLA
Modified: 2021-07-07 02:41 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.