KT-4893 Code completion should not show multiple functions with the same signature

#KT-4893 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-06-09 23:10:47 +03:00
parent 4c0e7e32e7
commit 483da9607c
43 changed files with 737 additions and 106 deletions
@@ -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 {