[kotlin] Port InitializePropertyQuickFixFactory to K2

^KTIJ-29621 Fixed

GitOrigin-RevId: 6c3d594880b4afce2f8ef2f7f1df5ec9ea601e52
This commit is contained in:
aleksandrina-streltsova
2024-07-12 20:35:30 +03:00
committed by intellij-monorepo-bot
parent 45ef647ae1
commit c433a4c2b1
66 changed files with 713 additions and 137 deletions

View File

@@ -184,4 +184,13 @@ fun KtExpression.prependDotQualifiedReceiver(receiver: KtExpression, factory: Kt
fun KtExpression.appendDotQualifiedSelector(selector: KtExpression, factory: KtPsiFactory): KtExpression {
val dotQualified = factory.createExpressionByPattern("$0.$1", this, selector)
return this.replaced(dotQualified)
}
fun KtSecondaryConstructor.getOrCreateBody(): KtBlockExpression {
bodyExpression?.let { return it }
val delegationCall = getDelegationCall()
val anchor = if (delegationCall.isImplicit) valueParameterList else delegationCall
val newBody = KtPsiFactory(project).createEmptyBody()
return addAfter(newBody, anchor) as KtBlockExpression
}