KT-4893 Code completion should not show multiple functions with the same signature
#KT-4893 Fixed
This commit is contained in:
@@ -29,7 +29,7 @@ public fun Call.mapArgumentsToParameters(targetDescriptor: CallableDescriptor):
|
||||
if (parameters.isEmpty()) return emptyMap()
|
||||
|
||||
val map = HashMap<ValueArgument, ValueParameterDescriptor>()
|
||||
val parametersByName = parameters.toMap { it.getName().asString() }
|
||||
val parametersByName = parameters.toMap { it.getName() }
|
||||
|
||||
var positionalArgumentIndex: Int? = 0
|
||||
|
||||
@@ -38,7 +38,7 @@ public fun Call.mapArgumentsToParameters(targetDescriptor: CallableDescriptor):
|
||||
map[argument] = parameters.last()
|
||||
}
|
||||
else {
|
||||
val argumentName = argument.getArgumentName()?.getReferenceExpression()?.getReferencedName()
|
||||
val argumentName = argument.getArgumentName()?.asName
|
||||
|
||||
if (argumentName != null) {
|
||||
if (targetDescriptor.hasStableParameterNames()) {
|
||||
|
||||
@@ -61,7 +61,7 @@ public fun JetFunctionLiteralArgument.moveInsideParenthesesAndReplaceWith(
|
||||
val newCallExpression = oldCallExpression.copy() as JetCallExpression
|
||||
|
||||
val psiFactory = JetPsiFactory(getProject())
|
||||
val argument = if (newCallExpression.getValueArgumentsInParentheses().any { it.getArgumentName() != null }) {
|
||||
val argument = if (newCallExpression.getValueArgumentsInParentheses().any { it.isNamed() }) {
|
||||
psiFactory.createArgument(replacement, functionLiteralArgumentName)
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user