Skip to content

Commit 0cc7ada

Browse files
committed
Javadoc @param description lost when retrieved from inheriting class.
- Surround javadoc param entry with a block tag entry. - Adjust ending entries for javadoc of param and exception tags - Fixes #1732 - Adjust existing testcase to handle param description Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
1 parent e67ae61 commit 0cc7ada

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/javadoc/JavadocContentAccess2.java

+5
Original file line numberDiff line numberDiff line change
@@ -1899,6 +1899,7 @@ private void handleExceptionTags(List<TagElement> tags, List<String> exceptionNa
18991899
}
19001900
}
19011901
fBuf.append(BLOCK_TAG_END);
1902+
fBuf.append(BlOCK_TAG_ENTRY_END);
19021903
}
19031904

19041905
private void handleThrowsTag(TagElement tag) {
@@ -1934,6 +1935,7 @@ private void handleParameterTags(List<TagElement> tags, List<String> parameterNa
19341935
String name = parameterNames.get(i);
19351936
if (name != null) {
19361937
fBuf.append(BLOCK_TAG_START);
1938+
fBuf.append(BlOCK_TAG_ENTRY_START);
19371939
fBuf.append(PARAM_NAME_START);
19381940
if (isTypeParameters) {
19391941
fBuf.append("&lt;"); //$NON-NLS-1$
@@ -1946,9 +1948,12 @@ private void handleParameterTags(List<TagElement> tags, List<String> parameterNa
19461948
if (description != null) {
19471949
fBuf.append(description);
19481950
}
1951+
fBuf.append(BlOCK_TAG_ENTRY_END);
19491952
fBuf.append(BLOCK_TAG_END);
19501953
}
19511954
}
1955+
1956+
fBuf.append(BlOCK_TAG_ENTRY_END);
19521957
}
19531958

19541959
private void handleParamTag(TagElement tag) {

org.eclipse.jdt.ls.tests/projects/eclipse/hello/src/java/Bar.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void somethingFromJPAModelGen(){}
2020
public void somethingElseFromLombok(){}
2121

2222
@Override
23-
public void foo() {
24-
super.foo();
23+
public void foo(String input) {
24+
super.foo("lombok");
2525
}
26-
}
26+
}

org.eclipse.jdt.ls.tests/projects/eclipse/hello/src/java/Foo.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public static void main(String[] args) {
1111

1212
/**
1313
* This method comes from Foo
14+
* @param input an input String
1415
*/
15-
public void foo() {}
16+
public void foo(String input) {}
1617
}

org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CodeLensHandlerTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public void testGetCodeLensSymbols() throws Exception {
150150
cl = result.get(1);
151151
r = cl.getRange();
152152
// CodeLens on foo method
153-
assertRange(14, 13, 16, r);
153+
assertRange(15, 13, 16, r);
154154

155155
cl = result.get(2);
156156
r = cl.getRange();

org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/HoverHandlerTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ public void testHoverInheritedJavadoc() throws Exception {
299299
// then
300300
assertNotNull(hover);
301301
String result = hover.getContents().getLeft().get(1).getLeft();//
302-
assertEquals("Unexpected hover ", "This method comes from Foo", result);
302+
String expected = "This method comes from Foo\n" + "\n" + " * **Parameters:**\n" + " \n" + " * **input** an input String";
303+
assertEquals("Unexpected hover ", expected, result);
303304
}
304305

305306
@Test

0 commit comments

Comments
 (0)