From ee409482b363f5ba4f6f8bc0e58a268747ac11c5 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 28 Jan 2016 10:12:15 +0000 Subject: [PATCH] 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 --- eclipse/eclipse-code-formatter.xml | 2 +- eclipse/org.eclipse.jdt.core.prefs | 2 +- eclipse/spring-boot-project.setup | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/eclipse/eclipse-code-formatter.xml b/eclipse/eclipse-code-formatter.xml index 2283e19f361..302f5c45cf5 100644 --- a/eclipse/eclipse-code-formatter.xml +++ b/eclipse/eclipse-code-formatter.xml @@ -65,7 +65,7 @@ - + diff --git a/eclipse/org.eclipse.jdt.core.prefs b/eclipse/org.eclipse.jdt.core.prefs index a61a84b4344..e44b6fc3667 100644 --- a/eclipse/org.eclipse.jdt.core.prefs +++ b/eclipse/org.eclipse.jdt.core.prefs @@ -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 diff --git a/eclipse/spring-boot-project.setup b/eclipse/spring-boot-project.setup index 513ed5143dc..2ce79552b07 100644 --- a/eclipse/spring-boot-project.setup +++ b/eclipse/spring-boot-project.setup @@ -223,6 +223,10 @@ xsi:type="setup:PreferenceTask" key="/instance/org.eclipse.jdt.ui/smartPaste" value="true"/> +