boolean (@NotNull PsiElement element) { resolveStarted.set(true); ApplicationManager.getApplication().assertReadAccessAllowed(); // emulate slow (but interruptible) resolve while (toSleepMs.addAndGet(-100) > 0) { ProgressManager.checkCanceled(); TimeoutUtil.sleep(100); } return super.isReferenceTo(element); }