From eaa797e0bc026532c891b7570f879bb4fb3ce448 Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Sun, 10 Oct 2010 22:54:27 +0400 Subject: [PATCH] allow show javascript own inspection results in inspection results view --- .../src/com/intellij/codeInspection/GlobalInspectionUtil.java | 2 +- .../intellij/codeInspection/ex/LocalInspectionToolWrapper.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/GlobalInspectionUtil.java b/platform/lang-impl/src/com/intellij/codeInspection/GlobalInspectionUtil.java index 2a253f474c73..e93e4365c39b 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/GlobalInspectionUtil.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/GlobalInspectionUtil.java @@ -29,7 +29,7 @@ import com.intellij.psi.PsiFile; public class GlobalInspectionUtil { private static final String LOC_MARKER = " #loc"; - static RefElement retrieveRefElement(PsiElement element, GlobalInspectionContext globalContext) { + public static RefElement retrieveRefElement(PsiElement element, GlobalInspectionContext globalContext) { PsiFile elementFile = element.getContainingFile(); RefElement refElement = globalContext.getRefManager().getReference(elementFile); if (refElement == null) { diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/LocalInspectionToolWrapper.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/LocalInspectionToolWrapper.java index 8586b1133a2e..0f9633076d0b 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/LocalInspectionToolWrapper.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/LocalInspectionToolWrapper.java @@ -101,6 +101,9 @@ public final class LocalInspectionToolWrapper extends DescriptorProviderInspecti final PsiNamedElement problemElement = myTool.getProblemElement(elt); RefElement refElement = refManager.getReference(problemElement); + if (refElement == null && problemElement != null) { // no need to loose collected results + refElement = GlobalInspectionUtil.retrieveRefElement(elt, getContext()); + } List elementProblems = problems.get(refElement); if (elementProblems == null) { elementProblems = new ArrayList();