ranges, int start, int end) {
+ for (TextRange range : ranges) {
+ if (range.intersectsStrict(start, end)) {
+ return true;
+ }
+ }
+ return false;
}
private enum State {TEXT, INSIDE_OPEN_TAG, INSIDE_CLOSE_TAG}
diff --git a/platform/lang-impl/testSources/com/intellij/codeInsight/navigation/DocPreviewUtilTest.groovy b/platform/lang-impl/testSources/com/intellij/codeInsight/navigation/DocPreviewUtilTest.groovy
index e9f4e1ebf11d..a67400a5e9fc 100644
--- a/platform/lang-impl/testSources/com/intellij/codeInsight/navigation/DocPreviewUtilTest.groovy
+++ b/platform/lang-impl/testSources/com/intellij/codeInsight/navigation/DocPreviewUtilTest.groovy
@@ -128,4 +128,21 @@ Bar
def actual = DocPreviewUtil.buildPreview(header, "java.lang.String", fullText)
assertEquals(expected, actual)
}
+
+ @Test
+ void crossingLinks() {
+ def header = '''\
+OCCompletionPriority
+com.jetbrains.objc.lang.completion.OCCompletionPriority SMART_COMPLETION_PRIORITY'''
+
+ def fullText = '''\
+ com.jetbrains.objc.lang.completion.OCCompletionPriorityOCCompletionPriority SMART_COMPLETION_PRIORITY
+
+Qname'''
+
+ def expected = '''\
+OCCompletionPriority
OCCompletionPriority SMART_COMPLETION_PRIORITY'''
+
+ assertEquals(expected, DocPreviewUtil.buildPreview(header, null, fullText))
+ }
}