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
pull/5052/head
Andy Wilkinson 9 years ago
parent 135ebb8ded
commit ee409482b3

@ -65,7 +65,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="90"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>

@ -383,7 +383,7 @@ org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_on_off_tags=true
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true

@ -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"

Loading…
Cancel
Save