Assert that the separation of two annotations on function type during rendering it, is any whitespace-like symbol, not only whitespace itself
E.g. in quick doc mode (HTML), it may be line break ^KT-38747 Fixed
This commit is contained in:
@@ -323,7 +323,7 @@ internal class DescriptorRendererImpl(
|
|||||||
insert(lengthBefore, '(')
|
insert(lengthBefore, '(')
|
||||||
} else {
|
} else {
|
||||||
if (hasAnnotations) {
|
if (hasAnnotations) {
|
||||||
assert(last() == ' ')
|
assert(last().isWhitespace())
|
||||||
if (get(lastIndex - 1) != ')') {
|
if (get(lastIndex - 1) != ')') {
|
||||||
// last annotation rendered without parenthesis - need to add them otherwise parsing will be incorrect
|
// last annotation rendered without parenthesis - need to add them otherwise parsing will be incorrect
|
||||||
insert(lastIndex, "()")
|
insert(lastIndex, "()")
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
fun myFun<caret>(param: @MyAnnotation (String.() -> Unit)) {} // quick documentation myFun
|
||||||
|
|
||||||
|
@Target(AnnotationTarget.TYPE)
|
||||||
|
annotation class MyAnnotation
|
||||||
|
|
||||||
|
//INFO: <div class='definition'><pre><font color="808080"><i>renderAnnotatedExtensionFunctionType.kt</i></font><br>public fun <b>myFun</b>(
|
||||||
|
//INFO: param: @<a href="psi_element://MyAnnotation">MyAnnotation</a>()
|
||||||
|
//INFO: (String.() → Unit)
|
||||||
|
//INFO: ): Unit</pre></div></pre></div><table class='sections'><p></table>
|
||||||
+5
@@ -274,6 +274,11 @@ public class QuickDocProviderTestGenerated extends AbstractQuickDocProviderTest
|
|||||||
runTest("idea/testData/editor/quickDoc/OnMethodUsageWithTypeParameter.kt");
|
runTest("idea/testData/editor/quickDoc/OnMethodUsageWithTypeParameter.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("renderAnnotatedExtensionFunctionType.kt")
|
||||||
|
public void testRenderAnnotatedExtensionFunctionType() throws Exception {
|
||||||
|
runTest("idea/testData/editor/quickDoc/renderAnnotatedExtensionFunctionType.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("Samples.kt")
|
@TestMetadata("Samples.kt")
|
||||||
public void testSamples() throws Exception {
|
public void testSamples() throws Exception {
|
||||||
runTest("idea/testData/editor/quickDoc/Samples.kt");
|
runTest("idea/testData/editor/quickDoc/Samples.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user