IDEA-201377 JavaDoc popup follow link issue

This commit is contained in:
Dmitry Batrak
2018-12-13 13:16:00 +03:00
parent 7466b9fc49
commit 628bb38fe5
4 changed files with 16 additions and 1 deletions
@@ -1213,7 +1213,8 @@ public class JavaDocInfoGenerator {
if (aClass != null) {
String qName = aClass.getQualifiedName();
if (qName != null) {
return StringUtil.repeat("../", StringUtil.countChars(qName, '.') + 1);
String path = StringUtil.repeat("../", StringUtil.countChars(qName, '.'));
return path.isEmpty() ? "" : path.substring(0, path.length() - 1);
}
}
@@ -0,0 +1,4 @@
<html><head><base href="placeholder"></head><body><div class='definition'><pre>foo.bar<br>class <b>Baz</b>
extends <a href="psi_element://java.lang.Object"><code>Object</code></a></pre></div><div class='content'>
<a href="../../someFile.html">link</a>
</div><table class='sections'><p></table>
@@ -0,0 +1,6 @@
package foo.bar;
/**
* <a href="{@docRoot}/someFile.html">link</a>
*/
class Baz {}
@@ -239,6 +239,10 @@ public class JavaDocInfoGeneratorTest extends CodeInsightTestCase {
doTestAtCaret();
}
public void testDocRoot() throws Exception {
doTestClass();
}
private void doTestClass() throws Exception {
PsiClass psiClass = getTestClass();
verifyJavaDoc(psiClass);