From f710215221cbb2d9dca96d295317df45a699e396 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Wed, 28 Dec 2011 16:58:55 +0400 Subject: [PATCH] running test inspections by language + inspection language fixes --- .../ex/InspectionToolWrapper.java | 8 ++++++-- .../ex/LocalInspectionToolWrapper.java | 4 ++++ .../impl/CodeInsightTestFixtureImpl.java | 18 +++++++++++++++--- resources/src/META-INF/IdeaPlugin.xml | 2 +- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java index 4123e2f6736b..2a9609e47a9a 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java @@ -40,12 +40,16 @@ public abstract class InspectionToolWrapper myExtensions = new HashMap(); public CodeInsightTestFixtureImpl(IdeaProjectTestFixture projectFixture, TempDirTestFixture tempDirTestFixture) { myProjectFixture = projectFixture; @@ -1024,6 +1026,10 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig DaemonCodeAnalyzerSettings.getInstance().setImportHintEnabled(false); ensureIndexesUpToDate(getProject()); ((StartupManagerImpl)StartupManagerEx.getInstanceEx(getProject())).runPostStartupActivities(); + LocalInspectionEP[] extensions = Extensions.getExtensions(LocalInspectionEP.LOCAL_INSPECTION); + for (LocalInspectionEP extension : extensions) { + myExtensions.put(extension.shortName, extension); + } } @Override @@ -1057,9 +1063,15 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig HighlightDisplayKey.register(shortName, tool.getDisplayName(), id); } myAvailableTools.put(shortName, tool); - myAvailableLocalTools.put(shortName, tool instanceof LocalInspectionTool ? - new LocalInspectionToolWrapper((LocalInspectionTool)tool) : - (InspectionTool)tool); + InspectionTool inspectionTool; + if (tool instanceof LocalInspectionTool) { + LocalInspectionEP ep = myExtensions.get(tool.getShortName()); + inspectionTool = new LocalInspectionToolWrapper((LocalInspectionTool)tool, ep); + } + else { + inspectionTool = (InspectionTool)tool; + } + myAvailableLocalTools.put(shortName, inspectionTool); } private void configureInspections(final InspectionProfileEntry[] tools) { diff --git a/resources/src/META-INF/IdeaPlugin.xml b/resources/src/META-INF/IdeaPlugin.xml index cb291100c94c..67cf4dc7faa9 100644 --- a/resources/src/META-INF/IdeaPlugin.xml +++ b/resources/src/META-INF/IdeaPlugin.xml @@ -430,7 +430,7 @@ -