do not retrieve element when pointer is sufficient

This commit is contained in:
anna
2012-04-16 14:24:31 +02:00
parent 04972c4d12
commit bbc5761036
@@ -87,6 +87,13 @@ public abstract class RefElementImpl extends RefEntityImpl implements RefElement
if (myIsDeleted) return false;
return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
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();
}