use of com.intellij.execution.impl.EditorHyperlinkSupport in project intellij by bazelbuild.
the class BlazeConsoleView method findLinkRange.
@Nullable
private RangeHighlighter findLinkRange(HyperlinkInfo link, int originalOffset) {
// first check if it's still at the same offset
Document doc = consoleView.getEditor().getDocument();
if (doc.getTextLength() <= originalOffset) {
return null;
}
int lineNumber = doc.getLineNumber(originalOffset);
EditorHyperlinkSupport helper = consoleView.getHyperlinks();
for (RangeHighlighter range : helper.findAllHyperlinksOnLine(lineNumber)) {
if (Objects.equals(EditorHyperlinkSupport.getHyperlinkInfo(range), link)) {
return range;
}
}
// fall back to searching all hyperlinks
return findRangeForHyperlink(link);
}
Aggregations