Fixed KT-5985 Smart completion does not insert comma for constructor of nested data class
#KT-5985 Fixed
This commit is contained in:
@@ -131,9 +131,18 @@ class ExpectedInfos(val bindingContext: BindingContext, val resolveSession: Reso
|
||||
val callOperationNode: ASTNode?
|
||||
if (parent is JetQualifiedExpression && callElement == parent.getSelectorExpression()) {
|
||||
val receiverExpression = parent.getReceiverExpression()
|
||||
val expressionType = bindingContext[BindingContext.EXPRESSION_TYPE, receiverExpression] ?: return null
|
||||
receiver = ExpressionReceiver(receiverExpression, expressionType)
|
||||
callOperationNode = parent.getOperationTokenNode()
|
||||
val expressionType = bindingContext[BindingContext.EXPRESSION_TYPE, receiverExpression]
|
||||
if (expressionType != null) {
|
||||
receiver = ExpressionReceiver(receiverExpression, expressionType)
|
||||
callOperationNode = parent.getOperationTokenNode()
|
||||
}
|
||||
else if (bindingContext[BindingContext.QUALIFIER, receiverExpression] != null) {
|
||||
receiver = ReceiverValue.NO_RECEIVER
|
||||
callOperationNode = null
|
||||
}
|
||||
else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
else {
|
||||
receiver = ReceiverValue.NO_RECEIVER
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class Outer {
|
||||
private data class Nested(val v: Int, val v2: Int)
|
||||
|
||||
fun foo(p: Int): Inner {
|
||||
return Outer.Nested(<caret>)
|
||||
}
|
||||
}
|
||||
|
||||
// ELEMENT: p
|
||||
@@ -0,0 +1,9 @@
|
||||
class Outer {
|
||||
private data class Nested(val v: Int, val v2: Int)
|
||||
|
||||
fun foo(p: Int): Inner {
|
||||
return Outer.Nested(p, <caret>)
|
||||
}
|
||||
}
|
||||
|
||||
// ELEMENT: p
|
||||
Reference in New Issue
Block a user