KT-14859 "Parameter Info" doesn't work properly in one case

#KT-14859 fixed
This commit is contained in:
Simon Ogorodnik
2017-01-23 16:58:45 +03:00
parent e3338c1e31
commit 5c52bdc684
3 changed files with 19 additions and 2 deletions
@@ -358,8 +358,8 @@ abstract class KotlinParameterInfoWithCallHandlerBase<TArgumentList : KtElement,
// First try to find strictly matching descriptor, then one with the same declaration.
// The second way is needed for the case when the descriptor was invalidated and new one has been built.
// See testLocalFunctionBug().
val resolvedCall = candidates.singleOrNull { it.resultingDescriptor.original == overload.original }
?: candidates.singleOrNull { descriptorsEqual(it.resultingDescriptor, overload) }
val resolvedCall = candidates.firstOrNull { it.resultingDescriptor.original == overload.original }
?: candidates.firstOrNull { descriptorsEqual(it.resultingDescriptor, overload) }
?: return null
val resultingDescriptor = resolvedCall.resultingDescriptor
@@ -0,0 +1,11 @@
fun String.method1(fn: String.() -> Unit = {}) {}
fun String.method2(param1: Int) {}
fun String.method3() {
method1 {
method2(<caret>)
}
}
/* Text: (<highlight>param1: Int</highlight>), Disabled: false, Strikeout: false, Green: true */
@@ -95,6 +95,12 @@ public class ParameterInfoTestGenerated extends AbstractParameterInfoTest {
doTest(fileName);
}
@TestMetadata("ExtensionOnCapturedScopeChange.kt")
public void testExtensionOnCapturedScopeChange() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/parameterInfo/functionCall/ExtensionOnCapturedScopeChange.kt");
doTest(fileName);
}
@TestMetadata("ExtensionOnClassObject.kt")
public void testExtensionOnClassObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/parameterInfo/functionCall/ExtensionOnClassObject.kt");