void (@Nls String text, @NotNull List<? extends LinkMatch> matches, @NotNull Consumer<? super @Nls String> textConsumer, @NotNull BiConsumer<? super @Nls String, ? super @NlsSafe String> linkWithTargetConsumer) { int pos = 0; for (IssueNavigationConfiguration.LinkMatch match : matches) { TextRange textRange = match.getRange(); LOG.assertTrue(pos <= textRange.getStartOffset()); if (textRange.getStartOffset() > pos) { textConsumer.accept(text.substring(pos, textRange.getStartOffset())); } linkWithTargetConsumer.accept(textRange.substring(text), match.getTargetUrl()); pos = textRange.getEndOffset(); } if (pos < text.length()) { textConsumer.accept(text.substring(pos)); } }