diff --git a/idea/src/org/jetbrains/kotlin/idea/parameterInfo/KotlinFunctionParameterInfoHandler.kt b/idea/src/org/jetbrains/kotlin/idea/parameterInfo/KotlinFunctionParameterInfoHandler.kt index 946600f9e66..ee8189031a8 100644 --- a/idea/src/org/jetbrains/kotlin/idea/parameterInfo/KotlinFunctionParameterInfoHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/parameterInfo/KotlinFunctionParameterInfoHandler.kt @@ -103,6 +103,15 @@ abstract class KotlinParameterInfoWithCallHandlerBase> = setOf( + KtNamedFunction::class.java, + KtVariableDeclaration::class.java, + KtValueArgumentList::class.java, + KtLambdaArgument::class.java, + KtContainerNode::class.java, + KtTypeArgumentList::class.java + ) + private val RENDERER = DescriptorRenderer.SHORT_NAMES_IN_TYPES.withOptions { enhancedTypes = true renderUnabbreviatedType = false @@ -115,7 +124,7 @@ abstract class KotlinParameterInfoWithCallHandlerBase> = STOP_SEARCH_CLASSES override fun getArgumentListClass() = argumentListClass.java @@ -141,7 +150,8 @@ abstract class KotlinParameterInfoWithCallHandlerBasearrayOf(1)[0] + } + } + }) +} + +fun withLambda(a: (Int) -> Unit) {} + +interface L { + fun on() +} + +class A { + fun subscribe(listener: L) {} +} + +/* +Text: (a: (Int) -> Unit), Disabled: false, Strikeout: false, Green: true +*/ + diff --git a/idea/testData/parameterInfo/typeArguments/ConflictingWithArgument.kt b/idea/testData/parameterInfo/typeArguments/ConflictingWithArgument.kt new file mode 100644 index 00000000000..5ae37362971 --- /dev/null +++ b/idea/testData/parameterInfo/typeArguments/ConflictingWithArgument.kt @@ -0,0 +1,27 @@ +// Possible parameter info, for index, lambda and arguments. +// Test is flaky without the fix. In IDEA there's a blinking without the fix with different popups. + +fun foo(a: A) { + a.subscribe(object : L { + override fun on() { + withLambda { + bar<>() + } + } + }) +} + +fun withLambda(a: (Int) -> Unit) {} +fun bar() {} + +interface L { + fun on() +} + +class A { + fun subscribe(listener: L) {} +} + +/* +Text: (T), Disabled: false, Strikeout: false, Green: false +*/ \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/ParameterInfoTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/ParameterInfoTestGenerated.java index 991ee4251d8..0dae4ba6942 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/ParameterInfoTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/ParameterInfoTestGenerated.java @@ -107,6 +107,11 @@ public class ParameterInfoTestGenerated extends AbstractParameterInfoTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/parameterInfo/functionCall"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("Conflicting.kt") + public void testConflicting() throws Exception { + runTest("idea/testData/parameterInfo/functionCall/Conflicting.kt"); + } + @TestMetadata("DefaultValuesFromLib.kt") public void testDefaultValuesFromLib() throws Exception { runTest("idea/testData/parameterInfo/functionCall/DefaultValuesFromLib.kt"); @@ -370,6 +375,11 @@ public class ParameterInfoTestGenerated extends AbstractParameterInfoTest { runTest("idea/testData/parameterInfo/typeArguments/BaseClass.kt"); } + @TestMetadata("ConflictingWithArgument.kt") + public void testConflictingWithArgument() throws Exception { + runTest("idea/testData/parameterInfo/typeArguments/ConflictingWithArgument.kt"); + } + @TestMetadata("Constraints.kt") public void testConstraints() throws Exception { runTest("idea/testData/parameterInfo/typeArguments/Constraints.kt");