File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/core/manipulation/internal/javadoc
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/hover Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ protected String removeDocLineIntros(String textWithSlashes) {
6262
6363 @ Override
6464 protected void handleLink (List <? extends ASTNode > fragments ) {
65- if (fragments .size () == 2 && fragments .get (0 ) instanceof TextElement ) {
65+ if (fragments .size () == 2 && fragments .get (0 ) instanceof TextElement && !( fragments . get ( 1 ) instanceof TextElement ) ) {
6666 // super method expects the reference as first fragment, optional label as second fragment
6767 fragments = Arrays .asList (fragments .get (1 ), fragments .get (0 ));
6868 }
Original file line number Diff line number Diff line change @@ -958,4 +958,29 @@ public int foo(int i) {
958958 String actualHtmlContent = getHoverHtmlContent (cu , method );
959959 assertHtmlContent (expectedContent , actualHtmlContent );
960960 }
961+
962+ @ Test
963+ public void test2068 () throws CoreException {
964+ String source = """
965+ package p;
966+
967+ public class X {
968+ /// @see <a href="https://www.eclipse.org">eclipse.org</a>
969+ /// x
970+ void foo() {}
971+ }
972+ """ ;
973+ ICompilationUnit cu = getWorkingCopy ("/TestSetupProject/src/p/X.java" , source , null );
974+ assertNotNull ("X.java" , cu );
975+
976+ IType type = cu .getType ("X" );
977+
978+ IMethod method = type .getMethods ()[0 ];
979+ String actualHtmlContent = getHoverHtmlContent (cu , method );
980+ String expectedContent = """
981+ <dl><dt>See Also:</dt><dd><a href="https://www.eclipse.org">eclipse.org</a>
982+ x</dd></dl>
983+ """ ;
984+ assertHtmlContent (expectedContent , actualHtmlContent );
985+ }
961986}
You can’t perform that action at this time.
0 commit comments