code review; add test for brackets around subject name in tag
This commit is contained in:
@@ -22,7 +22,7 @@ public class KDocLink(node: ASTNode) : KDocElementImpl(node) {
|
||||
fun getLinkText(): String {
|
||||
val text = getText()
|
||||
if (text.startsWith('[') && text.endsWith(']')) {
|
||||
return text.substring(1, text.length()-1)
|
||||
return text.substring(1, text.length() - 1)
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ fun renderKDoc(docComment: KDocTag): String {
|
||||
}
|
||||
|
||||
private fun renderTagList(tags: List<KDocTag>, title: String, to: StringBuilder) {
|
||||
if (tags.size() == 0) {
|
||||
if (tags.isEmpty()) {
|
||||
return
|
||||
}
|
||||
to.append("<dl><dt><b>${title}:</b></dt>")
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
Some documentation
|
||||
|
||||
* @param[a] Some int
|
||||
* @param[b] String
|
||||
*/
|
||||
fun testMethod(a: Int, b: String) {
|
||||
|
||||
}
|
||||
|
||||
fun test() {
|
||||
<caret>testMethod(1, "value")
|
||||
}
|
||||
|
||||
// INFO: <b>internal</b> <b>fun</b> testMethod(a: Int, b: String): Unit<br/><p>Some documentation<br/><br/><dl><dt><b>Parameters:</b></dt><dd><code>a</code> - Some int</dd><dd><code>b</code> - String</dd></dl></p>
|
||||
+7
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.idea.editor.quickDoc;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.InnerTestClasses;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.JetTestUtils;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
@@ -107,6 +108,12 @@ public class JetQuickDocProviderTestGenerated extends AbstractJetQuickDocProvide
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("OnMethodUsageWithBracketsInParam.kt")
|
||||
public void testOnMethodUsageWithBracketsInParam() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/editor/quickDoc/OnMethodUsageWithBracketsInParam.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("OnMethodUsageWithReturnAndThrows.kt")
|
||||
public void testOnMethodUsageWithReturnAndThrows() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/editor/quickDoc/OnMethodUsageWithReturnAndThrows.kt");
|
||||
|
||||
Reference in New Issue
Block a user