void (@NotNull Editor editor, @NotNull PsiMember member) { JavaCodeVisionUsageCollector.RELATED_PROBLEMS_CLICKED_EVENT_ID.log(member.getProject()); Map<PsiMember, Set<Problem>> problems = getReportedProblems(editor); Set<Problem> relatedProblems = problems.get(member); if (relatedProblems == null || relatedProblems.isEmpty()) return; Project project = member.getProject(); if (relatedProblems.size() == 1) { Problem problem = relatedProblems.iterator().next(); PsiElement reportedElement = problem.getReportedElement(); VirtualFile fileWithProblem = reportedElement.getContainingFile().getVirtualFile(); TextRange elementRange = reportedElement.getTextRange(); int offset = elementRange != null ? elementRange.getStartOffset() : -1; PsiNavigationSupport.getInstance().createNavigatable(project, fileWithProblem, offset).navigate(true); } else { String memberName = UsageViewUtil.getLongName(member); UsageViewPresentation presentation = new UsageViewPresentation(); String title = JavaBundle.message("project.problems.window.title", memberName); presentation.setCodeUsagesString(JavaBundle.message("project.problems.title")); presentation.setTabName(title); presentation.setTabText(title); Usage[] usages = ContainerUtil.map2Array(relatedProblems, new Usage[relatedProblems.size()], e -> { PsiElement reportedElement = e.getReportedElement(); UsageInfo usageInfo = new UsageInfo(e.getContext()); return new BrokenUsage(usageInfo, reportedElement); }); class MemberInfo { private final String myText; private final String myLocation; private final Icon myIcon; MemberInfo(String memberText, String memberLocation, Icon memberIcon) { myText = memberText; myLocation = memberLocation; myIcon = memberIcon; } } ReadAction.nonBlocking(() -> { ItemPresentation memberPresentation = member.getPresentation(); return memberPresentation == null ? null : new MemberInfo(memberPresentation.getPresentableText(), memberPresentation.getLocationString(), memberPresentation.getIcon(true)); }) .finishOnUiThread(ModalityState.any(), (info) -> { if (info == null) return; RelatedProblemTargetAdapter adapter = new RelatedProblemTargetAdapter(member, info.myText, info.myLocation, info.myIcon); UsageTarget[] usageTargets = new UsageTarget[]{adapter}; UsageViewManager usageViewManager = UsageViewManager.getInstance(project); usageViewManager.showUsages(usageTargets, usages, presentation); }) .submit(AppExecutorUtil.getAppExecutorService()); } }