Pull Up: Java -> Kotlin interoperability

#KT-5803 Fixed
This commit is contained in:
Alexey Sedunov
2015-08-06 16:20:12 +03:00
parent 556285f2c7
commit 7125989c69
50 changed files with 1337 additions and 337 deletions
@@ -148,4 +148,9 @@ private fun deleteElementWithDelimiters(element: PsiElement) {
public fun PsiElement.deleteSingle() {
CodeEditUtil.removeChild(getParent()?.getNode() ?: return, getNode() ?: return)
}
public fun JetClass.getOrCreateCompanionObject() : JetObjectDeclaration {
getCompanionObjects().firstOrNull()?.let { return it }
return addDeclaration(JetPsiFactory(this).createCompanionObject()) as JetObjectDeclaration
}