Enable the use of formatter off and on tags in Eclipse

This commit enables the use of // @formatter:off and // @formatter:on
to surround lines of code that should not be formatted. It also adds
a code template that can be used to quickly wrap the selected lines
of text with the off and on comments.

Closes gh-5050
This commit is contained in:
Andy Wilkinson
2016-01-28 10:12:15 +00:00
parent 135ebb8ded
commit ee409482b3
3 changed files with 6 additions and 2 deletions

View File

@@ -223,6 +223,10 @@
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.ui/smartPaste"
value="true"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.ui/org.eclipse.jdt.ui.text.custom_templates"
value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?>&lt;templates>&lt;template autoinsert=&quot;false&quot; context=&quot;java&quot; deleted=&quot;false&quot; description=&quot;Surround code with formatter off and formatter on tags&quot; enabled=&quot;true&quot; name=&quot;noformat&quot;>// @formatter:off&#xA;$${cursor} $${line_selection}&#xA;// @formatter:on&lt;/template>&lt;/templates>"/>
</setupTask>
<setupTask
xsi:type="setup:CompoundTask"