From bbc5761036c0b46279ab320532cdfa3f7266a875 Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 16 Apr 2012 13:16:19 +0200 Subject: [PATCH] do not retrieve element when pointer is sufficient --- .../intellij/codeInspection/reference/RefElementImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/reference/RefElementImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/reference/RefElementImpl.java index 8097af612960..9071543e5984 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/reference/RefElementImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/reference/RefElementImpl.java @@ -87,6 +87,13 @@ public abstract class RefElementImpl extends RefEntityImpl implements RefElement if (myIsDeleted) return false; return ApplicationManager.getApplication().runReadAction(new Computable() { public Boolean compute() { + + final PsiFile file = myID.getContainingFile(); + //no need to check resolve in offline mode + if (ApplicationManager.getApplication().isHeadlessEnvironment()) { + return file != null && file.isPhysical(); + } + final PsiElement element = getElement(); return element != null && element.isPhysical(); }