void (@NotNull PsiFile file, @NotNull Editor editor) { if (ApplicationManager.getApplication().isDispatchThread()) { assert !ApplicationManager.getApplication().isWriteAccessAllowed(): "must not call under write action"; Future<?> future = ApplicationManager.getApplication().executeOnPooledThread(() -> { if (!ReadAction.compute(() -> file.getProject().isDisposed() || editor.isDisposed())) { DaemonCodeAnalyzerImpl.waitForUnresolvedReferencesQuickFixesUnderCaret(file, editor); } }); try { while (!future.isDone()) { try { future.get(10, TimeUnit.MILLISECONDS); } catch (TimeoutException ignored) { } UIUtil.dispatchAllInvocationEvents(); } future.get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } } else { DaemonCodeAnalyzerImpl.waitForUnresolvedReferencesQuickFixesUnderCaret(file, editor); } }