void (@NotNull EditorEx editor, @NotNull InspectionResultsView view) { List<UsageInfo> usages = Arrays.stream(view.getTree().getAllValidSelectedDescriptors()) .filter(ProblemDescriptorBase.class::isInstance) .map(ProblemDescriptorBase.class::cast) .map(d -> { final PsiElement psi = d.getPsiElement(); if (psi == null) { return null; } final TextRange range = d.getTextRangeInElement(); return range == null ? new UsageInfo(psi) : new UsageInfo(psi, range.getStartOffset(), range.getEndOffset()); }) .collect(Collectors.toList()); setupFoldingsAndHighlightProblems(editor, view, usages, view.getProject()); }