Create actual fix: handle companions correctly #KT-21114 Fixed

This commit is contained in:
Mikhail Glukhikh
2017-12-29 20:06:44 +03:00
parent f46fa263ef
commit 5abb9dd23e
7 changed files with 48 additions and 2 deletions
@@ -179,7 +179,11 @@ class KtPsiFactory @JvmOverloads constructor(private val project: Project, val m
}
fun createCompanionObject(): KtObjectDeclaration {
return createClass("class A {\n companion object{\n}\n}").companionObjects.first()
return createCompanionObject("companion object {\n}")
}
fun createCompanionObject(text: String): KtObjectDeclaration {
return createClass("class A {\n $text\n}").companionObjects.first()
}
fun createFileAnnotation(annotationText: String): KtAnnotationEntry {