UAST: replacing deprecated JvmDeclarationUElement with JvmDeclarationUElementPlaceholder (#KT-23887)
To make it possible to delete `JvmDeclarationUElement` in IDEA-182
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.uast.kotlin
|
||||
|
||||
import org.jetbrains.uast.UElement
|
||||
|
||||
/**
|
||||
* Actual only for 173-bunch, please remove when 173 is over
|
||||
*/
|
||||
typealias JvmDeclarationUElementPlaceholder = UElement
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.uast.kotlin
|
||||
|
||||
import org.jetbrains.uast.UElement
|
||||
|
||||
/**
|
||||
* Actual only for 173-bunch, please remove when 173 is over
|
||||
*/
|
||||
typealias JvmDeclarationUElementPlaceholder = UElement
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.uast.kotlin
|
||||
|
||||
import org.jetbrains.uast.JvmDeclarationUElement
|
||||
|
||||
/**
|
||||
* Actual only for 173-bunch, please remove when 173 is over
|
||||
*/
|
||||
typealias JvmDeclarationUElementPlaceholder = JvmDeclarationUElement
|
||||
@@ -32,7 +32,8 @@ import org.jetbrains.uast.kotlin.expressions.KotlinUElvisExpression
|
||||
import org.jetbrains.uast.kotlin.internal.KotlinUElementWithComments
|
||||
import org.jetbrains.uast.kotlin.psi.UastKotlinPsiVariable
|
||||
|
||||
abstract class KotlinAbstractUElement(private val givenParent: UElement?) : KotlinUElementWithComments, UElement, JvmDeclarationUElement {
|
||||
abstract class KotlinAbstractUElement(private val givenParent: UElement?) : KotlinUElementWithComments,
|
||||
JvmDeclarationUElementPlaceholder {
|
||||
|
||||
final override val uastParent: UElement? by lz {
|
||||
givenParent ?: convertParent()
|
||||
@@ -202,7 +203,7 @@ private fun findAnnotationClassFromConstructorParameter(parameter: KtParameter):
|
||||
abstract class KotlinAbstractUExpression(givenParent: UElement?) :
|
||||
KotlinAbstractUElement(givenParent),
|
||||
UExpression,
|
||||
JvmDeclarationUElement {
|
||||
JvmDeclarationUElementPlaceholder {
|
||||
|
||||
override val javaPsi: PsiElement? = null
|
||||
|
||||
|
||||
@@ -29,7 +29,8 @@ import org.jetbrains.uast.kotlin.expressions.KotlinUElvisExpression
|
||||
import org.jetbrains.uast.kotlin.internal.KotlinUElementWithComments
|
||||
import org.jetbrains.uast.kotlin.psi.UastKotlinPsiVariable
|
||||
|
||||
abstract class KotlinAbstractUElement(private val givenParent: UElement?) : KotlinUElementWithComments, UElement {
|
||||
abstract class KotlinAbstractUElement(private val givenParent: UElement?) : KotlinUElementWithComments,
|
||||
JvmDeclarationUElementPlaceholder {
|
||||
|
||||
override val uastParent: UElement? by lz {
|
||||
givenParent ?: convertParent()
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.jetbrains.uast.kotlin.declarations.KotlinUMethod
|
||||
import org.jetbrains.uast.kotlin.declarations.UastLightIdentifier
|
||||
|
||||
abstract class AbstractKotlinUClass(givenParent: UElement?) : KotlinAbstractUElement(givenParent), UClassTypeSpecific, UAnchorOwner,
|
||||
JvmDeclarationUElement {
|
||||
JvmDeclarationUElementPlaceholder {
|
||||
|
||||
override val uastDeclarations by lz {
|
||||
mutableListOf<UDeclaration>().apply {
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.jetbrains.uast.*
|
||||
import org.jetbrains.uast.kotlin.declarations.KotlinUMethod
|
||||
import org.jetbrains.uast.kotlin.declarations.UastLightIdentifier
|
||||
|
||||
abstract class AbstractKotlinUClass(givenParent: UElement?) : KotlinAbstractUElement(givenParent), UClass, JvmDeclarationUElement {
|
||||
abstract class AbstractKotlinUClass(givenParent: UElement?) : KotlinAbstractUElement(givenParent), UClass, JvmDeclarationUElementPlaceholder {
|
||||
|
||||
override val uastDeclarations by lz {
|
||||
mutableListOf<UDeclaration>().apply {
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.jetbrains.uast.*
|
||||
import org.jetbrains.uast.kotlin.declarations.KotlinUMethod
|
||||
import org.jetbrains.uast.kotlin.declarations.UastLightIdentifier
|
||||
|
||||
abstract class AbstractKotlinUClass(givenParent: UElement?) : KotlinAbstractUElement(givenParent), UClass, JvmDeclarationUElement {
|
||||
abstract class AbstractKotlinUClass(givenParent: UElement?) : KotlinAbstractUElement(givenParent), UClass, JvmDeclarationUElementPlaceholder {
|
||||
|
||||
override val uastDeclarations by lz {
|
||||
mutableListOf<UDeclaration>().apply {
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.uast.*
|
||||
import java.util.*
|
||||
|
||||
class KotlinUFile(override val psi: KtFile, override val languagePlugin: UastLanguagePlugin) : UFile, JvmDeclarationUElement {
|
||||
class KotlinUFile(override val psi: KtFile, override val languagePlugin: UastLanguagePlugin) : UFile, JvmDeclarationUElementPlaceholder {
|
||||
override val packageName: String
|
||||
get() = psi.packageFqName.asString()
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ import org.jetbrains.uast.*
|
||||
import org.jetbrains.uast.internal.acceptList
|
||||
import org.jetbrains.uast.kotlin.declarations.KotlinUIdentifier
|
||||
import org.jetbrains.uast.kotlin.declarations.UastLightIdentifier
|
||||
import org.jetbrains.uast.kotlin.internal.KotlinUElementWithComments
|
||||
import org.jetbrains.uast.kotlin.psi.UastKotlinPsiParameter
|
||||
import org.jetbrains.uast.kotlin.psi.UastKotlinPsiVariable
|
||||
import org.jetbrains.uast.visitor.UastVisitor
|
||||
@@ -113,7 +112,7 @@ abstract class AbstractKotlinUVariable(givenParent: UElement?) : KotlinAbstractU
|
||||
override fun equals(other: Any?) = other is AbstractKotlinUVariable && psi == other.psi
|
||||
|
||||
class WrappedUAnnotation(psiAnnotation: PsiAnnotation, override val uastParent: UElement) : UAnnotation, UAnchorOwner,
|
||||
JvmDeclarationUElement {
|
||||
JvmDeclarationUElementPlaceholder {
|
||||
|
||||
override val javaPsi: PsiAnnotation = psiAnnotation
|
||||
override val psi: PsiAnnotation = javaPsi
|
||||
@@ -125,7 +124,8 @@ abstract class AbstractKotlinUVariable(givenParent: UElement?) : KotlinAbstractU
|
||||
|
||||
override val uastAnchor by lazy { KotlinUIdentifier(javaPsi.nameReferenceElement?.referenceNameElement, null, this) }
|
||||
|
||||
class WrappedUNamedExpression(pair: PsiNameValuePair, override val uastParent: UElement?) : UNamedExpression, JvmDeclarationUElement {
|
||||
class WrappedUNamedExpression(pair: PsiNameValuePair, override val uastParent: UElement?) : UNamedExpression,
|
||||
JvmDeclarationUElementPlaceholder {
|
||||
override val name: String? = pair.name
|
||||
override val psi = pair
|
||||
override val javaPsi: PsiElement? = psi
|
||||
@@ -233,7 +233,7 @@ class KotlinReceiverUParameter(
|
||||
}
|
||||
|
||||
class KotlinNullabilityUAnnotation(val annotatedElement: PsiElement, override val uastParent: UElement) : UAnnotationEx, UAnchorOwner,
|
||||
JvmDeclarationUElement {
|
||||
JvmDeclarationUElementPlaceholder {
|
||||
|
||||
private fun getTargetType(annotatedElement: PsiElement): KotlinType? {
|
||||
if (annotatedElement is KtTypeReference) {
|
||||
|
||||
+4
-3
@@ -99,7 +99,8 @@ abstract class AbstractKotlinUVariable(givenParent: UElement?)
|
||||
|
||||
override fun equals(other: Any?) = other is AbstractKotlinUVariable && psi == other.psi
|
||||
|
||||
class WrappedUAnnotation(psiAnnotation: PsiAnnotation, override val uastParent: UElement) : UAnnotation, JvmDeclarationUElement {
|
||||
class WrappedUAnnotation(psiAnnotation: PsiAnnotation, override val uastParent: UElement) : UAnnotation,
|
||||
JvmDeclarationUElementPlaceholder {
|
||||
|
||||
override val javaPsi: PsiAnnotation = psiAnnotation
|
||||
override val psi: PsiAnnotation = javaPsi
|
||||
@@ -109,7 +110,7 @@ abstract class AbstractKotlinUVariable(givenParent: UElement?)
|
||||
psi.parameterList.attributes.map { WrappedUNamedExpression(it, this) }
|
||||
}
|
||||
|
||||
class WrappedUNamedExpression(pair: PsiNameValuePair, override val uastParent: UElement?) : UNamedExpression, JvmDeclarationUElement {
|
||||
class WrappedUNamedExpression(pair: PsiNameValuePair, override val uastParent: UElement?) : UNamedExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val name: String? = pair.name
|
||||
override val psi = pair
|
||||
override val javaPsi: PsiElement? = psi
|
||||
@@ -216,7 +217,7 @@ class KotlinReceiverUParameter(
|
||||
|
||||
}
|
||||
|
||||
class KotlinNullabilityUAnnotation(val annotatedElement: PsiElement, override val uastParent: UElement) : UAnnotation, JvmDeclarationUElement {
|
||||
class KotlinNullabilityUAnnotation(val annotatedElement: PsiElement, override val uastParent: UElement) : UAnnotation, JvmDeclarationUElementPlaceholder {
|
||||
|
||||
private fun getTargetType(annotatedElement: PsiElement): KotlinType? {
|
||||
if (annotatedElement is KtTypeReference) {
|
||||
|
||||
+3
-3
@@ -99,7 +99,7 @@ abstract class AbstractKotlinUVariable(givenParent: UElement?)
|
||||
|
||||
override fun equals(other: Any?) = other is AbstractKotlinUVariable && psi == other.psi
|
||||
|
||||
class WrappedUAnnotation(psiAnnotation: PsiAnnotation, override val uastParent: UElement) : UAnnotation, JvmDeclarationUElement {
|
||||
class WrappedUAnnotation(psiAnnotation: PsiAnnotation, override val uastParent: UElement) : UAnnotation, JvmDeclarationUElementPlaceholder {
|
||||
|
||||
override val javaPsi: PsiAnnotation = psiAnnotation
|
||||
override val psi: PsiAnnotation = javaPsi
|
||||
@@ -109,7 +109,7 @@ abstract class AbstractKotlinUVariable(givenParent: UElement?)
|
||||
psi.parameterList.attributes.map { WrappedUNamedExpression(it, this) }
|
||||
}
|
||||
|
||||
class WrappedUNamedExpression(pair: PsiNameValuePair, override val uastParent: UElement?) : UNamedExpression, JvmDeclarationUElement {
|
||||
class WrappedUNamedExpression(pair: PsiNameValuePair, override val uastParent: UElement?) : UNamedExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val name: String? = pair.name
|
||||
override val psi = pair
|
||||
override val javaPsi: PsiElement? = psi
|
||||
@@ -216,7 +216,7 @@ class KotlinReceiverUParameter(
|
||||
|
||||
}
|
||||
|
||||
class KotlinNullabilityUAnnotation(val annotatedElement: PsiElement, override val uastParent: UElement) : UAnnotation, JvmDeclarationUElement {
|
||||
class KotlinNullabilityUAnnotation(val annotatedElement: PsiElement, override val uastParent: UElement) : UAnnotation, JvmDeclarationUElementPlaceholder {
|
||||
|
||||
private fun getTargetType(annotatedElement: PsiElement): KotlinType? {
|
||||
if (annotatedElement is KtTypeReference) {
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.jetbrains.uast.kotlin.psi.UastKotlinPsiVariable
|
||||
|
||||
|
||||
private fun createVariableReferenceExpression(variable: UVariable, containingElement: UElement?) =
|
||||
object : USimpleNameReferenceExpression, JvmDeclarationUElement {
|
||||
object : USimpleNameReferenceExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val psi: PsiElement? = null
|
||||
override fun resolve(): PsiElement? = variable
|
||||
override val uastParent: UElement? = containingElement
|
||||
@@ -27,7 +27,7 @@ private fun createVariableReferenceExpression(variable: UVariable, containingEle
|
||||
}
|
||||
|
||||
private fun createNullLiteralExpression(containingElement: UElement?) =
|
||||
object : ULiteralExpression, JvmDeclarationUElement {
|
||||
object : ULiteralExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val psi: PsiElement? = null
|
||||
override val uastParent: UElement? = containingElement
|
||||
override val value: Any? = null
|
||||
@@ -37,7 +37,7 @@ private fun createNullLiteralExpression(containingElement: UElement?) =
|
||||
}
|
||||
|
||||
private fun createNotEqWithNullExpression(variable: UVariable, containingElement: UElement?) =
|
||||
object : UBinaryExpression, JvmDeclarationUElement {
|
||||
object : UBinaryExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val psi: PsiElement? = null
|
||||
override val uastParent: UElement? = containingElement
|
||||
override val leftOperand: UExpression by lz { createVariableReferenceExpression(variable, this) }
|
||||
@@ -60,7 +60,7 @@ private fun createElvisExpressions(
|
||||
val tempVariable = KotlinULocalVariable(UastKotlinPsiVariable.create(left, declaration, psiParent), left, declaration)
|
||||
declaration.declarations = listOf(tempVariable)
|
||||
|
||||
val ifExpression = object : UIfExpression, JvmDeclarationUElement {
|
||||
val ifExpression = object : UIfExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val psi: PsiElement? = null
|
||||
override val uastParent: UElement? = containingElement
|
||||
override val javaPsi: PsiElement? = null
|
||||
|
||||
+4
-4
@@ -14,7 +14,7 @@ import org.jetbrains.uast.kotlin.psi.UastKotlinPsiVariable
|
||||
|
||||
|
||||
private fun createVariableReferenceExpression(variable: UVariable, containingElement: UElement?) =
|
||||
object : USimpleNameReferenceExpression, JvmDeclarationUElement {
|
||||
object : USimpleNameReferenceExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val psi: PsiElement? = null
|
||||
override fun resolve(): PsiElement? = variable
|
||||
override val uastParent: UElement? = containingElement
|
||||
@@ -26,7 +26,7 @@ private fun createVariableReferenceExpression(variable: UVariable, containingEle
|
||||
}
|
||||
|
||||
private fun createNullLiteralExpression(containingElement: UElement?) =
|
||||
object : ULiteralExpression, JvmDeclarationUElement {
|
||||
object : ULiteralExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val psi: PsiElement? = null
|
||||
override val uastParent: UElement? = containingElement
|
||||
override val value: Any? = null
|
||||
@@ -36,7 +36,7 @@ private fun createNullLiteralExpression(containingElement: UElement?) =
|
||||
}
|
||||
|
||||
private fun createNotEqWithNullExpression(variable: UVariable, containingElement: UElement?) =
|
||||
object : UBinaryExpression, JvmDeclarationUElement {
|
||||
object : UBinaryExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val psi: PsiElement? = null
|
||||
override val uastParent: UElement? = containingElement
|
||||
override val leftOperand: UExpression by lz { createVariableReferenceExpression(variable, this) }
|
||||
@@ -59,7 +59,7 @@ private fun createElvisExpressions(
|
||||
val tempVariable = KotlinULocalVariable(UastKotlinPsiVariable.create(left, declaration, psiParent), left, declaration)
|
||||
declaration.declarations = listOf(tempVariable)
|
||||
|
||||
val ifExpression = object : UIfExpression, JvmDeclarationUElement {
|
||||
val ifExpression = object : UIfExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val psi: PsiElement? = null
|
||||
override val uastParent: UElement? = containingElement
|
||||
override val javaPsi: PsiElement? = null
|
||||
|
||||
+4
-4
@@ -14,7 +14,7 @@ import org.jetbrains.uast.kotlin.psi.UastKotlinPsiVariable
|
||||
|
||||
|
||||
private fun createVariableReferenceExpression(variable: UVariable, containingElement: UElement?) =
|
||||
object : USimpleNameReferenceExpression, JvmDeclarationUElement {
|
||||
object : USimpleNameReferenceExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val psi: PsiElement? = null
|
||||
override fun resolve(): PsiElement? = variable
|
||||
override val uastParent: UElement? = containingElement
|
||||
@@ -26,7 +26,7 @@ private fun createVariableReferenceExpression(variable: UVariable, containingEle
|
||||
}
|
||||
|
||||
private fun createNullLiteralExpression(containingElement: UElement?) =
|
||||
object : ULiteralExpression, JvmDeclarationUElement {
|
||||
object : ULiteralExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val psi: PsiElement? = null
|
||||
override val uastParent: UElement? = containingElement
|
||||
override val value: Any? = null
|
||||
@@ -36,7 +36,7 @@ private fun createNullLiteralExpression(containingElement: UElement?) =
|
||||
}
|
||||
|
||||
private fun createNotEqWithNullExpression(variable: UVariable, containingElement: UElement?) =
|
||||
object : UBinaryExpression, JvmDeclarationUElement {
|
||||
object : UBinaryExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val psi: PsiElement? = null
|
||||
override val uastParent: UElement? = containingElement
|
||||
override val leftOperand: UExpression by lz { createVariableReferenceExpression(variable, this) }
|
||||
@@ -59,7 +59,7 @@ private fun createElvisExpressions(
|
||||
val tempVariable = KotlinULocalVariable(UastKotlinPsiVariable.create(left, declaration, psiParent), left, declaration)
|
||||
declaration.declarations = listOf(tempVariable)
|
||||
|
||||
val ifExpression = object : UIfExpression, JvmDeclarationUElement {
|
||||
val ifExpression = object : UIfExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val psi: PsiElement? = null
|
||||
override val uastParent: UElement? = containingElement
|
||||
override val javaPsi: PsiElement? = null
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ class KotlinUBlockExpression(
|
||||
class KotlinLazyUBlockExpression(
|
||||
override val uastParent: UElement?,
|
||||
expressionProducer: (expressionParent: UElement) -> List<UExpression>
|
||||
) : UBlockExpression, JvmDeclarationUElement {
|
||||
) : UBlockExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val psi: PsiElement? = null
|
||||
override val javaPsi: PsiElement? = null
|
||||
override val sourcePsi: PsiElement? = null
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ open class KotlinUSimpleReferenceExpression(
|
||||
private val resolvedCall: ResolvedCall<*>,
|
||||
private val accessorDescriptor: DeclarationDescriptor,
|
||||
val setterValue: KtExpression?
|
||||
) : UCallExpressionEx, JvmDeclarationUElement {
|
||||
) : UCallExpressionEx, JvmDeclarationUElementPlaceholder {
|
||||
override val methodName: String?
|
||||
get() = accessorDescriptor.name.asString()
|
||||
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ open class KotlinUSimpleReferenceExpression(
|
||||
private val resolvedCall: ResolvedCall<*>,
|
||||
private val accessorDescriptor: DeclarationDescriptor,
|
||||
val setterValue: KtExpression?
|
||||
) : UCallExpression, JvmDeclarationUElement {
|
||||
) : UCallExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val methodName: String?
|
||||
get() = accessorDescriptor.name.asString()
|
||||
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ open class KotlinUSimpleReferenceExpression(
|
||||
private val resolvedCall: ResolvedCall<*>,
|
||||
private val accessorDescriptor: DeclarationDescriptor,
|
||||
val setterValue: KtExpression?
|
||||
) : UCallExpression, JvmDeclarationUElement {
|
||||
) : UCallExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val methodName: String?
|
||||
get() = accessorDescriptor.name.asString()
|
||||
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ class KotlinUSwitchEntry(
|
||||
is KtBlockExpression -> exprPsi.statements.map { KotlinConverter.convertOrEmpty(it, this) }
|
||||
else -> listOf(KotlinConverter.convertOrEmpty(exprPsi, this))
|
||||
}
|
||||
expressions = userExpressions + object : UBreakExpression, JvmDeclarationUElement {
|
||||
expressions = userExpressions + object : UBreakExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val javaPsi: PsiElement? = null
|
||||
override val sourcePsi: PsiElement? = null
|
||||
override val psi: PsiElement?
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ class KotlinUSwitchEntry(
|
||||
is KtBlockExpression -> exprPsi.statements.map { KotlinConverter.convertOrEmpty(it, this) }
|
||||
else -> listOf(KotlinConverter.convertOrEmpty(exprPsi, this))
|
||||
}
|
||||
expressions = userExpressions + object : UBreakExpression, JvmDeclarationUElement {
|
||||
expressions = userExpressions + object : UBreakExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val javaPsi: PsiElement? = null
|
||||
override val sourcePsi: PsiElement? = null
|
||||
override val psi: PsiElement?
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ class KotlinUSwitchEntry(
|
||||
is KtBlockExpression -> exprPsi.statements.map { KotlinConverter.convertOrEmpty(it, this) }
|
||||
else -> listOf(KotlinConverter.convertOrEmpty(exprPsi, this))
|
||||
}
|
||||
expressions = userExpressions + object : UBreakExpression, JvmDeclarationUElement {
|
||||
expressions = userExpressions + object : UBreakExpression, JvmDeclarationUElementPlaceholder {
|
||||
override val javaPsi: PsiElement? = null
|
||||
override val sourcePsi: PsiElement? = null
|
||||
override val psi: PsiElement?
|
||||
|
||||
+2
-3
@@ -20,12 +20,11 @@ import com.intellij.psi.PsiComment
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiWhiteSpace
|
||||
import org.jetbrains.kotlin.psi.KtValueArgument
|
||||
import org.jetbrains.uast.JvmDeclarationUElement
|
||||
import org.jetbrains.uast.UComment
|
||||
import org.jetbrains.uast.UElement
|
||||
import org.jetbrains.uast.UExpression
|
||||
import org.jetbrains.uast.kotlin.JvmDeclarationUElementPlaceholder
|
||||
|
||||
interface KotlinUElementWithComments : UElement, JvmDeclarationUElement {
|
||||
interface KotlinUElementWithComments : JvmDeclarationUElementPlaceholder {
|
||||
|
||||
override val comments: List<UComment>
|
||||
get() {
|
||||
|
||||
+2
-1
@@ -23,8 +23,9 @@ import org.jetbrains.kotlin.psi.KtValueArgument
|
||||
import org.jetbrains.uast.UComment
|
||||
import org.jetbrains.uast.UElement
|
||||
import org.jetbrains.uast.UExpression
|
||||
import org.jetbrains.uast.kotlin.JvmDeclarationUElementPlaceholder
|
||||
|
||||
interface KotlinUElementWithComments : UElement {
|
||||
interface KotlinUElementWithComments : JvmDeclarationUElementPlaceholder {
|
||||
|
||||
override val comments: List<UComment>
|
||||
get() {
|
||||
|
||||
@@ -7,10 +7,10 @@ import com.intellij.psi.impl.source.tree.LeafPsiElement
|
||||
import org.jetbrains.kotlin.psi.KtElement
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.assertedCast
|
||||
import org.jetbrains.uast.JvmDeclarationUElement
|
||||
import org.jetbrains.uast.UAnchorOwner
|
||||
import org.jetbrains.uast.UElement
|
||||
import org.jetbrains.uast.UFile
|
||||
import org.jetbrains.uast.kotlin.JvmDeclarationUElementPlaceholder
|
||||
import org.jetbrains.uast.kotlin.KOTLIN_CACHED_UELEMENT_KEY
|
||||
import org.jetbrains.uast.kotlin.KotlinUastLanguagePlugin
|
||||
import org.jetbrains.uast.test.common.RenderLogTestBase
|
||||
@@ -108,7 +108,7 @@ abstract class AbstractKotlinRenderLogTest : AbstractKotlinUastTest(), RenderLog
|
||||
node.uastAnchor?.let { visitElement(it) }
|
||||
}
|
||||
|
||||
val jvmDeclaration = node as? JvmDeclarationUElement
|
||||
val jvmDeclaration = node as? JvmDeclarationUElementPlaceholder
|
||||
?: throw AssertionError("${node.javaClass} should implement 'JvmDeclarationUElement'")
|
||||
|
||||
jvmDeclaration.sourcePsi?.let {
|
||||
|
||||
@@ -7,10 +7,10 @@ import com.intellij.psi.impl.source.tree.LeafPsiElement
|
||||
import org.jetbrains.kotlin.psi.KtElement
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.assertedCast
|
||||
import org.jetbrains.uast.JvmDeclarationUElement
|
||||
import org.jetbrains.uast.UDeclaration
|
||||
import org.jetbrains.uast.UElement
|
||||
import org.jetbrains.uast.UFile
|
||||
import org.jetbrains.uast.kotlin.JvmDeclarationUElementPlaceholder
|
||||
import org.jetbrains.uast.kotlin.KOTLIN_CACHED_UELEMENT_KEY
|
||||
import org.jetbrains.uast.kotlin.KotlinUastLanguagePlugin
|
||||
import org.jetbrains.uast.test.common.RenderLogTestBase
|
||||
@@ -104,7 +104,7 @@ abstract class AbstractKotlinRenderLogTest : AbstractKotlinUastTest(), RenderLog
|
||||
accept(object : UastVisitor {
|
||||
override fun visitElement(node: UElement): Boolean {
|
||||
|
||||
val jvmDeclaration = node as? JvmDeclarationUElement
|
||||
val jvmDeclaration = node as? JvmDeclarationUElementPlaceholder
|
||||
?: throw AssertionError("${node.javaClass} should implement 'JvmDeclarationUElement'")
|
||||
|
||||
jvmDeclaration.sourcePsi?.let {
|
||||
|
||||
@@ -7,10 +7,10 @@ import com.intellij.psi.impl.source.tree.LeafPsiElement
|
||||
import org.jetbrains.kotlin.psi.KtElement
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.assertedCast
|
||||
import org.jetbrains.uast.JvmDeclarationUElement
|
||||
import org.jetbrains.uast.UDeclaration
|
||||
import org.jetbrains.uast.UElement
|
||||
import org.jetbrains.uast.UFile
|
||||
import org.jetbrains.uast.kotlin.JvmDeclarationUElementPlaceholder
|
||||
import org.jetbrains.uast.kotlin.KOTLIN_CACHED_UELEMENT_KEY
|
||||
import org.jetbrains.uast.kotlin.KotlinUastLanguagePlugin
|
||||
import org.jetbrains.uast.test.common.RenderLogTestBase
|
||||
@@ -104,7 +104,7 @@ abstract class AbstractKotlinRenderLogTest : AbstractKotlinUastTest(), RenderLog
|
||||
accept(object : UastVisitor {
|
||||
override fun visitElement(node: UElement): Boolean {
|
||||
|
||||
val jvmDeclaration = node as? JvmDeclarationUElement
|
||||
val jvmDeclaration = node as? JvmDeclarationUElementPlaceholder
|
||||
?: throw AssertionError("${node.javaClass} should implement 'JvmDeclarationUElement'")
|
||||
|
||||
jvmDeclaration.sourcePsi?.let {
|
||||
|
||||
Reference in New Issue
Block a user