diff --git a/.idea/dictionaries/valentin.xml b/.idea/dictionaries/valentin.xml index 916bc6632c0..55471258d54 100644 --- a/.idea/dictionaries/valentin.xml +++ b/.idea/dictionaries/valentin.xml @@ -2,6 +2,7 @@ pparent + rparenth \ No newline at end of file diff --git a/idea/src/org/jetbrains/jet/plugin/completion/ExpectedInfos.kt b/idea/src/org/jetbrains/jet/plugin/completion/ExpectedInfos.kt index b57700ddfd4..c12bbe225f6 100644 --- a/idea/src/org/jetbrains/jet/plugin/completion/ExpectedInfos.kt +++ b/idea/src/org/jetbrains/jet/plugin/completion/ExpectedInfos.kt @@ -52,7 +52,7 @@ import org.jetbrains.jet.lang.resolve.calls.util.hasUnmappedParameters enum class Tail { COMMA - PARENTHESIS + RPARENTH ELSE } @@ -139,7 +139,7 @@ class ExpectedInfos(val bindingContext: BindingContext, val moduleDescriptor: Mo if (parameters.size <= argumentIndex) continue } val parameterDescriptor = parameters[argumentIndex] - val tail = if (isFunctionLiteralArgument) null else if (argumentIndex == parameters.size - 1) Tail.PARENTHESIS else Tail.COMMA + val tail = if (isFunctionLiteralArgument) null else if (argumentIndex == parameters.size - 1) Tail.RPARENTH else Tail.COMMA expectedInfos.add(ExpectedInfo(parameterDescriptor.getType(), tail)) } } @@ -164,7 +164,7 @@ class ExpectedInfos(val bindingContext: BindingContext, val moduleDescriptor: Mo private fun calculateForIf(expressionWithType: JetExpression): Collection? { val ifExpression = (expressionWithType.getParent() as? JetContainerNode)?.getParent() as? JetIfExpression ?: return null return when (expressionWithType) { - ifExpression.getCondition() -> listOf(ExpectedInfo(KotlinBuiltIns.getInstance().getBooleanType(), Tail.PARENTHESIS)) + ifExpression.getCondition() -> listOf(ExpectedInfo(KotlinBuiltIns.getInstance().getBooleanType(), Tail.RPARENTH)) ifExpression.getThen() -> calculate(ifExpression)?.map { ExpectedInfo(it.`type`, Tail.ELSE) } diff --git a/idea/src/org/jetbrains/jet/plugin/completion/smart/Utils.kt b/idea/src/org/jetbrains/jet/plugin/completion/smart/Utils.kt index 89b0b53ed5c..866c5ef312d 100644 --- a/idea/src/org/jetbrains/jet/plugin/completion/smart/Utils.kt +++ b/idea/src/org/jetbrains/jet/plugin/completion/smart/Utils.kt @@ -73,7 +73,7 @@ fun LookupElement.addTail(tail: Tail?): LookupElement { } } - Tail.PARENTHESIS -> object: LookupElementDecorator(this) { + Tail.RPARENTH -> object: LookupElementDecorator(this) { override fun handleInsert(context: InsertionContext) { handlers.WithTailInsertHandler(")", spaceBefore = false, spaceAfter = false).handleInsert(context, getDelegate()) }