From eb3c98a6750a4ff7c23f23c10bdb5d2d8afcc6c6 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sun, 5 Apr 2015 04:20:59 +0200 Subject: fixed the ‘cleanup/codeformat on save’ save cleanup action in Eclipse Mars. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java') diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java index 9906c4d4..28e8d0c1 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java +++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java @@ -312,6 +312,13 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable { .callToWrap(new Hook("org.eclipse.jdt.internal.corext.util.CodeFormatterUtil", "reformat", "org.eclipse.text.edits.TextEdit", "int", "java.lang.String", "int", "int", "int", "java.lang.String", "java.util.Map")) .symbol("lombok.disable").build()); + + sm.addScript(ScriptBuilder.setSymbolDuringMethodCall() + .target(new MethodTarget("org.eclipse.jdt.internal.corext.fix.CodeFormatFix", "createCleanUp", "org.eclipse.jdt.ui.cleanup.ICleanUpFix", + "org.eclipse.jdt.core.ICompilationUnit", "org.eclipse.jface.text.IRegion[]", "boolean", "boolean", "boolean", "boolean")) + .callToWrap(new Hook("org.eclipse.jdt.internal.corext.util.CodeFormatterUtil", "reformat", "org.eclipse.text.edits.TextEdit", + "int", "java.lang.String", "int", "java.lang.String", "java.util.Map")) + .symbol("lombok.disable").build()); } private static void patchRefactorScripts(ScriptManager sm) { -- cgit