Uast: consistency for imports-expressions
This commit is contained in:
@@ -86,6 +86,10 @@ abstract class KotlinAbstractUElement(private val givenParent: UElement?) : UEle
|
|||||||
parent = parent.parent
|
parent = parent.parent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parent is KtImportList) {
|
||||||
|
parent = parent.parent
|
||||||
|
}
|
||||||
|
|
||||||
if (psi is KtSuperTypeCallEntry) {
|
if (psi is KtSuperTypeCallEntry) {
|
||||||
parent = parent?.parent
|
parent = parent?.parent
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ internal object KotlinConverter {
|
|||||||
?.toUElementOfType<UExpression>()
|
?.toUElementOfType<UExpression>()
|
||||||
?: KotlinUFunctionCallExpression(element, givenParent)
|
?: KotlinUFunctionCallExpression(element, givenParent)
|
||||||
}
|
}
|
||||||
|
is KtImportDirective -> el<UImportStatement>(build(::KotlinUImportStatement))
|
||||||
else -> {
|
else -> {
|
||||||
if (element is LeafPsiElement && element.elementType == KtTokens.IDENTIFIER) {
|
if (element is LeafPsiElement && element.elementType == KtTokens.IDENTIFIER) {
|
||||||
el<UIdentifier>(build(::UIdentifier))
|
el<UIdentifier>(build(::UIdentifier))
|
||||||
|
|||||||
@@ -69,8 +69,5 @@ class SimpleKotlinRenderLogTest : AbstractKotlinRenderLogTest() {
|
|||||||
fun testReceiverFun() = doTest("ReceiverFun")
|
fun testReceiverFun() = doTest("ReceiverFun")
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testAnonymous() = doTest("Anonymous") { testName, file ->
|
fun testAnonymous() = doTest("Anonymous")
|
||||||
//Disabled because cant convert IMPORT_DIRECTIVE
|
|
||||||
check(testName, file, false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user