From 4b0502ec881197e0822066b11c6d5a6b27db020c Mon Sep 17 00:00:00 2001 From: Alexander Kirillin Date: Fri, 4 Feb 2011 15:57:16 +0300 Subject: [PATCH 1/3] inspections --- .../daemon/impl/LocalInspectionsPassFactory.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPassFactory.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPassFactory.java index 368be146dd9b..5258b42db531 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPassFactory.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPassFactory.java @@ -27,6 +27,7 @@ import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiFile; +import com.intellij.util.PlatformUtils; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -40,7 +41,13 @@ import java.util.List; public class LocalInspectionsPassFactory extends AbstractProjectComponent implements TextEditorHighlightingPassFactory { public LocalInspectionsPassFactory(Project project, TextEditorHighlightingPassRegistrar highlightingPassRegistrar) { super(project); - highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, new int[]{Pass.UPDATE_ALL/*, Pass.POPUP_HINTS*/}, true, Pass.LOCAL_INSPECTIONS); + + if ( PlatformUtils.isCidr()) { //TODO rework this hack + highlightingPassRegistrar.registerTextEditorHighlightingPass(this, new int[]{Pass.UPDATE_ALL/*, Pass.POPUP_HINTS*/}, null, true, Pass.LOCAL_INSPECTIONS); + } + else { + highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, new int[]{Pass.UPDATE_ALL/*, Pass.POPUP_HINTS*/}, true, Pass.LOCAL_INSPECTIONS); + } } @NonNls From 366a97ca9862d3f2d2cc092943d13070223eea52 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Mon, 14 Feb 2011 17:55:25 +0100 Subject: [PATCH 2/3] even more compiler logging --- .../impl/javaCompiler/BackendCompilerWrapper.java | 11 +++++++++-- .../src/com/intellij/rt/compiler/JavacRunner.java | 8 +++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java index 3a324d87aa74..9a25ec6014f8 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java @@ -21,11 +21,11 @@ */ package com.intellij.compiler.impl.javaCompiler; -import com.intellij.codeInsight.AnnotationUtil; import com.intellij.codeInsight.NullableNotNullManager; import com.intellij.compiler.*; import com.intellij.compiler.classParsing.AnnotationConstantValue; import com.intellij.compiler.classParsing.MethodInfo; +import com.intellij.compiler.impl.CompileDriver; import com.intellij.compiler.impl.CompilerUtil; import com.intellij.compiler.make.Cache; import com.intellij.compiler.make.CacheCorruptedException; @@ -348,7 +348,7 @@ public class BackendCompilerWrapper { int exitValue = 0; try { - Process process = myCompiler.launchProcess(chunk, outputDir, myCompileContext); + final Process process = myCompiler.launchProcess(chunk, outputDir, myCompileContext); final long compilationStart = System.currentTimeMillis(); final ClassParsingThread classParsingThread = new ClassParsingThread(isJdk6(chunk.getJdk()), outputDir); final Future classParsingThreadFuture = ApplicationManager.getApplication().executeOnPooledThread(classParsingThread); @@ -377,10 +377,17 @@ public class BackendCompilerWrapper { exitValue = process.waitFor(); } catch (InterruptedException e) { + if (CompileDriver.ourDebugMode) { + System.out.println("Compiler interrupted; "); + e.printStackTrace(); + } process.destroy(); exitValue = process.exitValue(); } finally { + if (CompileDriver.ourDebugMode) { + System.out.println("Compiler exit code is " + exitValue); + } if (errorParsingThread != null) { errorParsingThread.setProcessTerminated(true); } diff --git a/java/java-runtime/src/com/intellij/rt/compiler/JavacRunner.java b/java/java-runtime/src/com/intellij/rt/compiler/JavacRunner.java index 4a07ff98f2db..a45414624992 100644 --- a/java/java-runtime/src/com/intellij/rt/compiler/JavacRunner.java +++ b/java/java-runtime/src/com/intellij/rt/compiler/JavacRunner.java @@ -67,7 +67,13 @@ public class JavacRunner { System.arraycopy(args, 2, newArgs, 0, newArgs.length); } expandClasspath(newArgs); - mainMethod.invoke(null, new Object[] {newArgs}); + try { + mainMethod.invoke(null, new Object[] {newArgs}); + } + catch (Throwable e) { + System.err.print(e.getMessage()); + e.printStackTrace(System.err); + } } private static void addFilesToCompile(Vector arguments, String path) throws IOException { From d273b8409b6e446dabcc6eb4ea314e3d0a72b3ad Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 14 Feb 2011 17:22:21 +0100 Subject: [PATCH 3/3] allow adding idea.jar to IDEA SDK by default --- plugins/devkit/src/projectRoots/IdeaJdk.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/devkit/src/projectRoots/IdeaJdk.java b/plugins/devkit/src/projectRoots/IdeaJdk.java index 51f114ffce7e..e99615bc92b6 100644 --- a/plugins/devkit/src/projectRoots/IdeaJdk.java +++ b/plugins/devkit/src/projectRoots/IdeaJdk.java @@ -171,7 +171,7 @@ public class IdeaJdk extends SdkType implements JavaSdkType { private static VirtualFile[] getIdeaLibrary(String home) { ArrayList result = new ArrayList(); - appendIdeaLibrary(home + File.separator + LIB_DIR_NAME, "idea.jar", result); + appendIdeaLibrary(home + File.separator + LIB_DIR_NAME, null, result); appendIdeaLibrary(home + File.separator + PLUGINS_DIR + File.separator + JAVAEE_DIR + File.separator + LIB_DIR_NAME, "javaee-impl.jar", result); appendIdeaLibrary(home + File.separator + PLUGINS_DIR + File.separator + JSF_DIR + File.separator + LIB_DIR_NAME, "jsf-impl.jar", result);