allow show javascript own inspection results in inspection results view

This commit is contained in:
Maxim.Mossienko
2010-10-10 22:55:04 +04:00
parent 23782339e2
commit eaa797e0bc
2 changed files with 4 additions and 1 deletions
@@ -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) {
@@ -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<ProblemDescriptor> elementProblems = problems.get(refElement);
if (elementProblems == null) {
elementProblems = new ArrayList<ProblemDescriptor>();