void (@NotNull Project project, @NotNull VirtualFile file, @NotNull Editor targetEditor, @Nullable Editor originalEditor) { if (DumbService.isDumb(project)) return; // may need to resolve refs Document document = FileDocumentManager.getInstance().getDocument(file); if (document == null || document.getLineCount() <= myLineNumber) return; if (!PsiDocumentManager.getInstance(project).isCommitted(document)) return; int startOffset = document.getLineStartOffset(myLineNumber); int endOffset = document.getLineEndOffset(myLineNumber); ThrowableComputable<LinkInfo, RuntimeException> computable = () -> ReadAction.compute( () -> computeLinkInfo(project, file, startOffset, endOffset, targetEditor, originalEditor)); LinkInfo info = ProgressIndicatorUtils.withTimeout(LINK_INFO_TIMEOUT_MS, () -> SlowOperations.allowSlowOperations(computable)); if (info == null) return; if (info.myTarget != null) { TextRange range = info.myTarget.getTextRange(); targetEditor.getCaretModel().moveToOffset(range.getStartOffset()); } if (info.myAction != null && !ApplicationManager.getApplication().isUnitTestMode()) { displayAnalysisAction(project, info, targetEditor); } }