void (@NotNull final Document copiedFragment, final int startOffset, int startLineNumber, @NotNull final Consumer<? super AdditionalHighlight> consumer) { Map<String, ExceptionWorker.ParsedLine> visited = new HashMap<>(); ExceptionWorker.ParsedLine emptyInfo = new ExceptionWorker.ParsedLine(TextRange.EMPTY_RANGE, TextRange.EMPTY_RANGE, TextRange.EMPTY_RANGE, null, -1); final ExceptionLineParser worker = myFactory.create(myCache); for (int i = 0; i < copiedFragment.getLineCount(); i++) { final int lineStartOffset = copiedFragment.getLineStartOffset(i); final int lineEndOffset = copiedFragment.getLineEndOffset(i); String lineText = copiedFragment.getText(new TextRange(lineStartOffset, lineEndOffset)); if (!lineText.contains(".java:")) continue; ExceptionWorker.ParsedLine info = visited.get(lineText); if (info == emptyInfo) continue; if (info == null) { info = ReadAction.compute(() -> DumbService.isDumb(worker.getProject()) ? null : doParse(worker, lineEndOffset, lineText)); visited.put(lineText, info == null ? emptyInfo : info); if (info == null) { continue; } } int off = startOffset + lineStartOffset; final Color color = NamedColorUtil.getInactiveTextColor(); consumer.consume(new AdditionalHighlight(off + info.classFqnRange.getStartOffset(), off + info.methodNameRange.getEndOffset()) { @NotNull @Override public TextAttributes getTextAttributes(@Nullable TextAttributes source) { return new TextAttributes(null, null, color, EffectType.BOLD_DOTTED_LINE, Font.PLAIN); } }); } }