diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinAbstractUElement.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinAbstractUElement.kt index 397bde72333..5feb90aff7c 100644 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinAbstractUElement.kt +++ b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinAbstractUElement.kt @@ -86,6 +86,10 @@ abstract class KotlinAbstractUElement(private val givenParent: UElement?) : UEle parent = parent.parent } + if (parent is KtImportList) { + parent = parent.parent + } + if (psi is KtSuperTypeCallEntry) { parent = parent?.parent } diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinUastLanguagePlugin.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinUastLanguagePlugin.kt index 063b38baf0a..73ddf132a62 100644 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinUastLanguagePlugin.kt +++ b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinUastLanguagePlugin.kt @@ -321,7 +321,7 @@ internal object KotlinConverter { ?.toUElementOfType() ?: KotlinUFunctionCallExpression(element, givenParent) } - + is KtImportDirective -> el(build(::KotlinUImportStatement)) else -> { if (element is LeafPsiElement && element.elementType == KtTokens.IDENTIFIER) { el(build(::UIdentifier)) diff --git a/plugins/uast-kotlin/tests/SimpleKotlinRenderLogTest.kt b/plugins/uast-kotlin/tests/SimpleKotlinRenderLogTest.kt index d4cea81061d..e06cf29402e 100644 --- a/plugins/uast-kotlin/tests/SimpleKotlinRenderLogTest.kt +++ b/plugins/uast-kotlin/tests/SimpleKotlinRenderLogTest.kt @@ -69,8 +69,5 @@ class SimpleKotlinRenderLogTest : AbstractKotlinRenderLogTest() { fun testReceiverFun() = doTest("ReceiverFun") @Test - fun testAnonymous() = doTest("Anonymous") { testName, file -> - //Disabled because cant convert IMPORT_DIRECTIVE - check(testName, file, false) - } + fun testAnonymous() = doTest("Anonymous") }