Changed behavior
This commit is contained in:
+9
-6
@@ -47,14 +47,17 @@ class InsertHandlerProvider(
|
||||
0 -> KotlinFunctionInsertHandler.Normal(needTypeArguments, inputValueArguments = false)
|
||||
|
||||
1 -> {
|
||||
val parameterType = parameters.single().getType()
|
||||
if (KotlinBuiltIns.isExactFunctionOrExtensionFunctionType(parameterType)) {
|
||||
val parameterCount = KotlinBuiltIns.getParameterTypeProjectionsFromFunctionType(parameterType).size()
|
||||
if (parameterCount <= 1) {
|
||||
// otherwise additional item with lambda template is to be added
|
||||
return KotlinFunctionInsertHandler.Normal(needTypeArguments, inputValueArguments = false, lambdaInfo = GenerateLambdaInfo(parameterType, false))
|
||||
if (callType != CallType.SUPER_MEMBERS) { // for super call we don't suggest to generate "super.foo { ... }" (seems to be non-typical use)
|
||||
val parameterType = parameters.single().getType()
|
||||
if (KotlinBuiltIns.isExactFunctionOrExtensionFunctionType(parameterType)) {
|
||||
val parameterCount = KotlinBuiltIns.getParameterTypeProjectionsFromFunctionType(parameterType).size()
|
||||
if (parameterCount <= 1) {
|
||||
// otherwise additional item with lambda template is to be added
|
||||
return KotlinFunctionInsertHandler.Normal(needTypeArguments, inputValueArguments = false, lambdaInfo = GenerateLambdaInfo(parameterType, false))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
KotlinFunctionInsertHandler.Normal(needTypeArguments, inputValueArguments = true)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ class LookupElementFactory(
|
||||
result.add(lookupElement)
|
||||
|
||||
// add special item for function with one argument of function type with more than one parameter
|
||||
if (descriptor is FunctionDescriptor && isNormalCall) {
|
||||
if (descriptor is FunctionDescriptor && isNormalCall && callType != CallType.SUPER_MEMBERS) {
|
||||
result.addSpecialFunctionCallElements(descriptor, useReceiverTypes)
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,6 @@ abstract class A : Base(), I {
|
||||
// EXIST_JAVA_ONLY: { itemText: "getAbsolutePath", attributes: "" }
|
||||
// ABSENT: absolutePath
|
||||
|
||||
// EXIST: { itemText: "onLambda1", tailText: " {...} (p: () -> Unit)", attributes: "" }
|
||||
// EXIST: { itemText: "onLambda1", tailText: "(p: () -> Unit)", attributes: "" }
|
||||
// EXIST: { itemText: "onLambda2", tailText: "(p: (Int, String) -> Unit)", attributes: "" }
|
||||
// EXIST: { itemText: "onLambda2", tailText: " { Int, String -> ... } (p: (Int, String) -> Unit)", attributes: "" }
|
||||
// ABSENT: { itemText: "onLambda2", tailText: " { Int, String -> ... } (p: (Int, String) -> Unit)" }
|
||||
|
||||
Reference in New Issue
Block a user