From 9c18df61ca561f299cd0f195dd2a5e91d50530a9 Mon Sep 17 00:00:00 2001 From: Nicolay Mitropolsky Date: Mon, 21 Oct 2019 15:17:02 +0300 Subject: [PATCH] Uast: `KotlinUMethod` and `KotlinUAnnotationMethod` are separated (KT-30489) --- .../uast/kotlin/declarations/KotlinUClass.kt | 19 ++--- .../uast/kotlin/declarations/KotlinUMethod.kt | 73 +++++++++++-------- .../kotlin/declarations/KotlinUMethod.kt.183 | 67 ++++++++++------- .../kotlin/declarations/KotlinUMethod.kt.191 | 68 ++++++++++------- .../testData/AnnotationComplex.log.txt | 10 +-- .../testData/AnnotationParameters.log.txt | 8 +- .../testData/Anonymous.identifiers.txt | 14 ++-- .../uast-kotlin/testData/Anonymous.log.txt | 20 ++--- .../uast-kotlin/testData/Assertion.values.txt | 2 +- .../testData/Assertion.values.txt.183 | 10 --- .../testData/ClassAnnotation.altlog.txt | 2 +- .../testData/ClassAnnotation.log.txt | 10 +-- .../testData/ConstructorDelegate.log.txt | 18 ++--- .../testData/Constructors.identifiers.txt | 14 ++-- .../uast-kotlin/testData/Constructors.log.txt | 36 ++++----- .../testData/CycleInTypeParameters.types.txt | 4 +- .../uast-kotlin/testData/DefaultImpls.log.txt | 4 +- .../testData/DefaultParameterValues.log.txt | 2 +- plugins/uast-kotlin/testData/Delegate.log.txt | 16 ++-- .../uast-kotlin/testData/Delegate.values.txt | 16 ++-- .../testData/DestructuringDeclaration.log.txt | 2 +- plugins/uast-kotlin/testData/Elvis.log.txt | 6 +- .../testData/EnumValueMembers.log.txt | 10 +-- .../uast-kotlin/testData/IfStatement.log.txt | 2 +- plugins/uast-kotlin/testData/In.values.txt | 2 +- ...renceInsideUnresolvedConstructor.types.txt | 4 +- .../testData/InnerClasses.altlog.txt | 12 +-- .../uast-kotlin/testData/InnerClasses.log.txt | 14 ++-- .../testData/InnerClasses.splog.txt | 6 +- .../InnerNonFixedTypeVariable.types.txt | 4 +- .../uast-kotlin/testData/LambdaReturn.log.txt | 4 +- plugins/uast-kotlin/testData/Lambdas.log.txt | 4 +- .../testData/LocalDeclarations.altlog.txt | 2 +- .../LocalDeclarations.identifiers.txt | 2 +- .../testData/LocalDeclarations.log.txt | 6 +- .../testData/LocalDeclarations.types.txt | 6 +- .../testData/LocalDeclarations.values.txt | 6 +- .../LocalVariableWithAnnotation.log.txt | 2 +- ...ParameterPropertyWithAnnotation.altlog.txt | 12 +-- .../ParameterPropertyWithAnnotation.log.txt | 12 +-- .../testData/ParametersDisorder.log.txt | 18 ++--- .../ParametersWithDefaultValues.log.txt | 2 +- .../testData/PropertyAccessors.log.txt | 8 +- .../testData/PropertyDelegate.log.txt | 6 +- .../testData/PropertyInitializer.log.txt | 6 +- .../PropertyInitializerWithoutSetter.log.txt | 4 +- .../testData/PropertyWithAnnotation.log.txt | 8 +- .../testData/QualifiedConstructorCall.log.txt | 6 +- .../uast-kotlin/testData/ReceiverFun.log.txt | 2 +- plugins/uast-kotlin/testData/Simple.log.txt | 6 +- .../uast-kotlin/testData/Simple.values.txt | 6 +- .../testData/SimpleAnnotated.identifiers.txt | 2 +- .../uast-kotlin/testData/SimpleScript.log.txt | 18 ++--- .../testData/StringTemplate.log.txt | 8 +- .../testData/StringTemplate.types.txt | 8 +- .../testData/StringTemplateComplex.log.txt | 14 ++-- .../testData/StringTemplateComplex.types.txt | 14 ++-- ...ngTemplateComplexForUInjectionHost.log.txt | 14 ++-- .../testData/SuperCalls.identifiers.txt | 14 ++-- .../uast-kotlin/testData/SuperCalls.log.txt | 32 ++++---- .../testData/TypeReferences.log.txt | 4 +- .../UnexpectedContainerException.log.txt | 10 +-- .../UnexpectedContainerException.types.txt | 10 +-- .../testData/WhenAndDestructing.log.txt | 2 +- plugins/uast-kotlin/testData/WhenIs.log.txt | 2 +- .../testData/WhenStringLiteral.log.txt | 6 +- .../uast-kotlin/testData/ea101715.types.txt | 4 +- 67 files changed, 396 insertions(+), 369 deletions(-) delete mode 100644 plugins/uast-kotlin/testData/Assertion.values.txt.183 diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUClass.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUClass.kt index dbc87864f51..6868a52391c 100644 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUClass.kt +++ b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUClass.kt @@ -176,10 +176,10 @@ open class KotlinUClass private constructor( } open class KotlinConstructorUMethod( - private val ktClass: KtClassOrObject?, - override val psi: KtLightMethod, - givenParent: UElement? -) : KotlinUMethod(psi, givenParent) { + private val ktClass: KtClassOrObject?, + override val psi: KtLightMethod, + givenParent: UElement? +) : KotlinUMethod(psi, psi.kotlinOrigin, givenParent) { val isPrimary: Boolean get() = psi.kotlinOrigin.let { it is KtPrimaryConstructor || it is KtClassOrObject } @@ -216,8 +216,6 @@ open class KotlinConstructorUMethod( override val javaPsi = psi - override val sourcePsi = psi.kotlinOrigin - open protected fun getBodyExpressions(): List { if (isPrimary) return getInitializers() val bodyExpression = (psi.kotlinOrigin as? KtFunction)?.bodyExpression ?: return emptyList() @@ -307,16 +305,15 @@ class KotlinScriptUClass( override fun getOriginalElement(): PsiElement? = psi.originalElement class KotlinScriptConstructorUMethod( - script: KtScript, - override val psi: KtLightMethod, - givenParent: UElement? - ) : KotlinUMethod(psi, givenParent) { + script: KtScript, + override val psi: KtLightMethod, + givenParent: UElement? + ) : KotlinUMethod(psi, psi.kotlinOrigin, givenParent) { override val uastBody: UExpression? by lz { val initializers = script.declarations.filterIsInstance() KotlinUBlockExpression.create(initializers, this) } override val javaPsi = psi - override val sourcePsi = psi.kotlinOrigin } } diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUMethod.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUMethod.kt index 543e2041ad2..2b346e5370b 100644 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUMethod.kt +++ b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUMethod.kt @@ -16,41 +16,39 @@ package org.jetbrains.uast.kotlin.declarations -import com.intellij.psi.* +import com.intellij.psi.PsiFile +import com.intellij.psi.PsiMethod +import com.intellij.psi.PsiNameIdentifierOwner import org.jetbrains.kotlin.asJava.elements.KtLightElement import org.jetbrains.kotlin.asJava.elements.KtLightMethod import org.jetbrains.kotlin.asJava.elements.isGetter import org.jetbrains.kotlin.asJava.elements.isSetter -import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject +import org.jetbrains.kotlin.psi.psiUtil.getParentOfType import org.jetbrains.kotlin.utils.SmartList import org.jetbrains.uast.* import org.jetbrains.uast.java.internal.JavaUElementWithComments import org.jetbrains.uast.kotlin.* open class KotlinUMethod( - psi: KtLightMethod, - givenParent: UElement? -) : KotlinAbstractUElement(givenParent), UAnnotationMethod, UMethodTypeSpecific, UAnchorOwner, JavaUElementWithComments, PsiMethod by psi { + psi: PsiMethod, + final override val sourcePsi: KtDeclaration?, + givenParent: UElement? +) : KotlinAbstractUElement(givenParent), UMethodTypeSpecific, UAnchorOwner, JavaUElementWithComments, PsiMethod by psi { + + constructor(psi: KtLightMethod, givenParent: UElement?) : this(psi, psi.kotlinOrigin, givenParent) + override val comments: List get() = super.comments - override val psi: KtLightMethod = unwrap(psi) + override val psi: PsiMethod = unwrap(psi) override val javaPsi = psi - override val sourcePsi = psi.kotlinOrigin - override fun getSourceElement() = sourcePsi ?: this - override val uastDefaultValue by lz { - val annotationParameter = psi.kotlinOrigin as? KtParameter ?: return@lz null - val defaultValue = annotationParameter.defaultValue ?: return@lz null - getLanguagePlugin().convertElement(defaultValue, this) as? UExpression - } - - private val kotlinOrigin = (psi.originalElement as KtLightElement<*, *>).kotlinOrigin + private val kotlinOrigin = (psi.originalElement as? KtLightElement<*, *>)?.kotlinOrigin ?: sourcePsi override fun getContainingFile(): PsiFile? = unwrapFakeFileForLightClass(psi.containingFile) @@ -95,8 +93,8 @@ open class KotlinUMethod( val bodyExpression = when (kotlinOrigin) { is KtFunction -> kotlinOrigin.bodyExpression is KtProperty -> when { - psi.isGetter -> kotlinOrigin.getter?.bodyExpression - psi.isSetter -> kotlinOrigin.setter?.bodyExpression + psi is KtLightMethod && psi.isGetter -> kotlinOrigin.getter?.bodyExpression + psi is KtLightMethod && psi.isSetter -> kotlinOrigin.setter?.bodyExpression else -> null } else -> null @@ -105,9 +103,6 @@ open class KotlinUMethod( wrapExpressionBody(this, bodyExpression) } - override fun getBody(): PsiCodeBlock? = super.getBody() - - override fun getOriginalElement(): PsiElement? = super.getOriginalElement() override val returnTypeReference: UTypeReferenceExpression? by lz { (sourcePsi as? KtCallableDeclaration)?.typeReference?.let { @@ -118,18 +113,38 @@ open class KotlinUMethod( override fun equals(other: Any?) = other is KotlinUMethod && psi == other.psi companion object { - fun create(psi: KtLightMethod, containingElement: UElement?) = - if (psi.kotlinOrigin is KtConstructor<*>) { - KotlinConstructorUMethod( - psi.kotlinOrigin?.containingClassOrObject, - psi, containingElement - ) - } - else - KotlinUMethod(psi, containingElement) + fun create(psi: KtLightMethod, containingElement: UElement?): KotlinUMethod { + val kotlinOrigin = psi.kotlinOrigin + return if (kotlinOrigin is KtConstructor<*>) { + KotlinConstructorUMethod( + kotlinOrigin.containingClassOrObject, + psi, + containingElement + ) + } else if (kotlinOrigin is KtParameter && kotlinOrigin.getParentOfType(true)?.isAnnotation() == true) + KotlinUAnnotationMethod(psi, containingElement) + else + KotlinUMethod(psi, containingElement) + } } } +open class KotlinUAnnotationMethod( + psi: KtLightMethod, + givenParent: UElement? +) : KotlinUMethod(psi, psi.kotlinOrigin, givenParent), UAnnotationMethod { + + override val psi: KtLightMethod = unwrap(psi) + + override val uastDefaultValue by lz { + val annotationParameter = sourcePsi as? KtParameter ?: return@lz null + val defaultValue = annotationParameter.defaultValue ?: return@lz null + getLanguagePlugin().convertElement(defaultValue, this) as? UExpression + } + + +} + internal fun wrapExpressionBody(function: UElement, bodyExpression: KtExpression): UExpression? = when (bodyExpression) { !is KtBlockExpression -> { KotlinUBlockExpression.KotlinLazyUBlockExpression(function) { block -> diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUMethod.kt.183 b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUMethod.kt.183 index 6230aabae73..c337dcb9b4c 100644 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUMethod.kt.183 +++ b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUMethod.kt.183 @@ -30,27 +30,23 @@ import org.jetbrains.uast.java.internal.JavaUElementWithComments import org.jetbrains.uast.kotlin.* open class KotlinUMethod( - psi: KtLightMethod, - givenParent: UElement? -) : KotlinAbstractUElement(givenParent), UAnnotationMethod, UMethodTypeSpecific, UAnchorOwner, JavaUElementWithComments, PsiMethod by psi { + psi: PsiMethod, + final override val sourcePsi: KtDeclaration?, + givenParent: UElement? +) : KotlinAbstractUElement(givenParent), UMethodTypeSpecific, UAnchorOwner, JavaUElementWithComments, PsiMethod by psi { + + constructor(psi: KtLightMethod, givenParent: UElement?) : this(psi, psi.kotlinOrigin, givenParent) + override val comments: List get() = super.comments - override val psi: KtLightMethod = unwrap(psi) + override val psi: PsiMethod = unwrap(psi) override val javaPsi = psi - override val sourcePsi = psi.kotlinOrigin - override fun getSourceElement() = sourcePsi ?: this - override val uastDefaultValue by lz { - val annotationParameter = psi.kotlinOrigin as? KtParameter ?: return@lz null - val defaultValue = annotationParameter.defaultValue ?: return@lz null - getLanguagePlugin().convertElement(defaultValue, this) as? UExpression - } - - private val kotlinOrigin = (psi.originalElement as KtLightElement<*, *>).kotlinOrigin + private val kotlinOrigin = (psi.originalElement as? KtLightElement<*, *>)?.kotlinOrigin ?: sourcePsi override fun getContainingFile(): PsiFile? = unwrapFakeFileForLightClass(psi.containingFile) @@ -95,8 +91,8 @@ open class KotlinUMethod( val bodyExpression = when (kotlinOrigin) { is KtFunction -> kotlinOrigin.bodyExpression is KtProperty -> when { - psi.isGetter -> kotlinOrigin.getter?.bodyExpression - psi.isSetter -> kotlinOrigin.setter?.bodyExpression + psi is KtLightMethod && psi.isGetter -> kotlinOrigin.getter?.bodyExpression + psi is KtLightMethod && psi.isSetter -> kotlinOrigin.setter?.bodyExpression else -> null } else -> null @@ -108,25 +104,42 @@ open class KotlinUMethod( override val isOverride: Boolean get() = (kotlinOrigin as? KtCallableDeclaration)?.hasModifier(KtTokens.OVERRIDE_KEYWORD) ?: false - override fun getBody(): PsiCodeBlock? = super.getBody() - - override fun getOriginalElement(): PsiElement? = super.getOriginalElement() override fun equals(other: Any?) = other is KotlinUMethod && psi == other.psi companion object { - fun create(psi: KtLightMethod, containingElement: UElement?) = - if (psi.kotlinOrigin is KtConstructor<*>) { - KotlinConstructorUMethod( - psi.kotlinOrigin?.containingClassOrObject, - psi, containingElement - ) - } - else - KotlinUMethod(psi, containingElement) + fun create(psi: KtLightMethod, containingElement: UElement?): KotlinUMethod { + val kotlinOrigin = psi.kotlinOrigin + return if (kotlinOrigin is KtConstructor<*>) { + KotlinConstructorUMethod( + kotlinOrigin.containingClassOrObject, + psi, + containingElement + ) + } else if (kotlinOrigin is KtParameter && kotlinOrigin.getParentOfType(true)?.isAnnotation() == true) + KotlinUAnnotationMethod(psi, containingElement) + else + KotlinUMethod(psi, containingElement) + } } } +open class KotlinUAnnotationMethod( + psi: KtLightMethod, + givenParent: UElement? +) : KotlinUMethod(psi, psi.kotlinOrigin, givenParent), UAnnotationMethod { + + override val psi: KtLightMethod = unwrap(psi) + + override val uastDefaultValue by lz { + val annotationParameter = sourcePsi as? KtParameter ?: return@lz null + val defaultValue = annotationParameter.defaultValue ?: return@lz null + getLanguagePlugin().convertElement(defaultValue, this) as? UExpression + } + + +} + internal fun wrapExpressionBody(function: UElement, bodyExpression: KtExpression): UExpression? = when (bodyExpression) { !is KtBlockExpression -> { KotlinUBlockExpression.KotlinLazyUBlockExpression(function) { block -> diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUMethod.kt.191 b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUMethod.kt.191 index 764a2ceb594..d43a290a5e8 100644 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUMethod.kt.191 +++ b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUMethod.kt.191 @@ -30,27 +30,23 @@ import org.jetbrains.uast.java.internal.JavaUElementWithComments import org.jetbrains.uast.kotlin.* open class KotlinUMethod( - psi: KtLightMethod, - givenParent: UElement? -) : KotlinAbstractUElement(givenParent), UAnnotationMethod, UMethodTypeSpecific, UAnchorOwner, JavaUElementWithComments, PsiMethod by psi { + psi: PsiMethod, + final override val sourcePsi: KtDeclaration?, + givenParent: UElement? +) : KotlinAbstractUElement(givenParent), UMethodTypeSpecific, UAnchorOwner, JavaUElementWithComments, PsiMethod by psi { + + constructor(psi: KtLightMethod, givenParent: UElement?) : this(psi, psi.kotlinOrigin, givenParent) + override val comments: List get() = super.comments - override val psi: KtLightMethod = unwrap(psi) + override val psi: PsiMethod = unwrap(psi) override val javaPsi = psi - override val sourcePsi = psi.kotlinOrigin - override fun getSourceElement() = sourcePsi ?: this - override val uastDefaultValue by lz { - val annotationParameter = psi.kotlinOrigin as? KtParameter ?: return@lz null - val defaultValue = annotationParameter.defaultValue ?: return@lz null - getLanguagePlugin().convertElement(defaultValue, this) as? UExpression - } - - private val kotlinOrigin = (psi.originalElement as KtLightElement<*, *>).kotlinOrigin + private val kotlinOrigin = (psi.originalElement as? KtLightElement<*, *>)?.kotlinOrigin ?: sourcePsi override fun getContainingFile(): PsiFile? = unwrapFakeFileForLightClass(psi.containingFile) @@ -95,8 +91,8 @@ open class KotlinUMethod( val bodyExpression = when (kotlinOrigin) { is KtFunction -> kotlinOrigin.bodyExpression is KtProperty -> when { - psi.isGetter -> kotlinOrigin.getter?.bodyExpression - psi.isSetter -> kotlinOrigin.setter?.bodyExpression + psi is KtLightMethod && psi.isGetter -> kotlinOrigin.getter?.bodyExpression + psi is KtLightMethod && psi.isSetter -> kotlinOrigin.setter?.bodyExpression else -> null } else -> null @@ -108,10 +104,6 @@ open class KotlinUMethod( override val isOverride: Boolean get() = (kotlinOrigin as? KtCallableDeclaration)?.hasModifier(KtTokens.OVERRIDE_KEYWORD) ?: false - override fun getBody(): PsiCodeBlock? = super.getBody() - - override fun getOriginalElement(): PsiElement? = super.getOriginalElement() - override val returnTypeReference: UTypeReferenceExpression? by lz { (sourcePsi as? KtCallableDeclaration)?.typeReference?.let { LazyKotlinUTypeReferenceExpression(it, this) { javaPsi.returnType ?: UastErrorType } @@ -121,18 +113,38 @@ open class KotlinUMethod( override fun equals(other: Any?) = other is KotlinUMethod && psi == other.psi companion object { - fun create(psi: KtLightMethod, containingElement: UElement?) = - if (psi.kotlinOrigin is KtConstructor<*>) { - KotlinConstructorUMethod( - psi.kotlinOrigin?.containingClassOrObject, - psi, containingElement - ) - } - else - KotlinUMethod(psi, containingElement) + fun create(psi: KtLightMethod, containingElement: UElement?): KotlinUMethod { + val kotlinOrigin = psi.kotlinOrigin + return if (kotlinOrigin is KtConstructor<*>) { + KotlinConstructorUMethod( + kotlinOrigin.containingClassOrObject, + psi, + containingElement + ) + } else if (kotlinOrigin is KtParameter && kotlinOrigin.getParentOfType(true)?.isAnnotation() == true) + KotlinUAnnotationMethod(psi, containingElement) + else + KotlinUMethod(psi, containingElement) + } } } +open class KotlinUAnnotationMethod( + psi: KtLightMethod, + givenParent: UElement? +) : KotlinUMethod(psi, psi.kotlinOrigin, givenParent), UAnnotationMethod { + + override val psi: KtLightMethod = unwrap(psi) + + override val uastDefaultValue by lz { + val annotationParameter = sourcePsi as? KtParameter ?: return@lz null + val defaultValue = annotationParameter.defaultValue ?: return@lz null + getLanguagePlugin().convertElement(defaultValue, this) as? UExpression + } + + +} + internal fun wrapExpressionBody(function: UElement, bodyExpression: KtExpression): UExpression? = when (bodyExpression) { !is KtBlockExpression -> { KotlinUBlockExpression.KotlinLazyUBlockExpression(function) { block -> diff --git a/plugins/uast-kotlin/testData/AnnotationComplex.log.txt b/plugins/uast-kotlin/testData/AnnotationComplex.log.txt index 8fa610961fb..75c68f444ed 100644 --- a/plugins/uast-kotlin/testData/AnnotationComplex.log.txt +++ b/plugins/uast-kotlin/testData/AnnotationComplex.log.txt @@ -3,7 +3,7 @@ UFile (package = ) UAnnotationMethod (name = strings) UClass (name = A) UAnnotation (fqName = Annotation) - UAnnotationMethod (name = A) + UMethod (name = A) UClass (name = AnnotationInner) UAnnotationMethod (name = value) UClass (name = B1) @@ -12,7 +12,7 @@ UFile (package = ) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (Annotation)) USimpleNameReferenceExpression (identifier = , resolvesTo = Annotation) - UAnnotationMethod (name = B1) + UMethod (name = B1) UClass (name = B2) UAnnotation (fqName = AnnotationArray) UNamedExpression (name = value) @@ -21,7 +21,7 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = , resolvesTo = Annotation) ULiteralExpression (value = "sv1") ULiteralExpression (value = "sv2") - UAnnotationMethod (name = B2) + UMethod (name = B2) UClass (name = AnnotationArray) UAnnotationMethod (name = value) UClass (name = C) @@ -35,7 +35,7 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = arrayOf, resolvesTo = null) ULiteralExpression (value = "sar1") ULiteralExpression (value = "sar2") - UAnnotationMethod (name = C) + UMethod (name = C) UClass (name = C2) UAnnotation (fqName = AnnotationArray) UNamedExpression (name = value) @@ -46,4 +46,4 @@ UFile (package = ) UIdentifier (Identifier ([)) ULiteralExpression (value = "[sar]1") ULiteralExpression (value = "[sar]2") - UAnnotationMethod (name = C2) + UMethod (name = C2) diff --git a/plugins/uast-kotlin/testData/AnnotationParameters.log.txt b/plugins/uast-kotlin/testData/AnnotationParameters.log.txt index f4598cf0c49..fe14237f6a7 100644 --- a/plugins/uast-kotlin/testData/AnnotationParameters.log.txt +++ b/plugins/uast-kotlin/testData/AnnotationParameters.log.txt @@ -1,6 +1,6 @@ UFile (package = ) UClass (name = AnnotationParametersKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UAnnotation (fqName = RequiresPermission) UNamedExpression (name = anyOf) UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 3)) @@ -21,7 +21,7 @@ UFile (package = ) UBlockExpression UReturnExpression ULiteralExpression (value = 5) - UAnnotationMethod (name = bar) + UMethod (name = bar) UAnnotation (fqName = IntRange) UNamedExpression (name = from) ULiteralExpression (value = 0) @@ -36,7 +36,7 @@ UFile (package = ) UBlockExpression UReturnExpression USimpleNameReferenceExpression (identifier = Unit) - UAnnotationMethod (name = fooWithArrLiteral) + UMethod (name = fooWithArrLiteral) UAnnotation (fqName = RequiresPermission) UNamedExpression (name = anyOf) UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 3)) @@ -47,7 +47,7 @@ UFile (package = ) UBlockExpression UReturnExpression ULiteralExpression (value = 5) - UAnnotationMethod (name = fooWithStrArrLiteral) + UMethod (name = fooWithStrArrLiteral) UAnnotation (fqName = RequiresStrPermission) UNamedExpression (name = strs) UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 3)) diff --git a/plugins/uast-kotlin/testData/Anonymous.identifiers.txt b/plugins/uast-kotlin/testData/Anonymous.identifiers.txt index b79f2db7340..3baab0d8d46 100644 --- a/plugins/uast-kotlin/testData/Anonymous.identifiers.txt +++ b/plugins/uast-kotlin/testData/Anonymous.identifiers.txt @@ -4,11 +4,11 @@ Closeable -> USimpleNameReferenceExpression (identifier = Closeable) java -> USimpleNameReferenceExpression (identifier = java) io -> USimpleNameReferenceExpression (identifier = io) InputStream -> USimpleNameReferenceExpression (identifier = InputStream) -foo -> UAnnotationMethod (name = foo) +foo -> UMethod (name = foo) runnable -> ULocalVariable (name = runnable) object -> UClass (name = null) Runnable -> USimpleNameReferenceExpression (identifier = Runnable) - run -> UAnnotationMethod (name = run) + run -> UMethod (name = run) runnable -> USimpleNameReferenceExpression (identifier = runnable) run -> UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) runnable2 -> ULocalVariable (name = runnable2) @@ -20,16 +20,16 @@ foo -> UAnnotationMethod (name = foo) object -> UClass (name = null) Runnable -> USimpleNameReferenceExpression (identifier = Runnable) Closeable -> USimpleNameReferenceExpression (identifier = Closeable) - close -> UAnnotationMethod (name = close) - run -> UAnnotationMethod (name = run) + close -> UMethod (name = close) + run -> UMethod (name = run) runnableIs -> ULocalVariable (name = runnableIs) object -> UClass (name = null) InputStream -> UObjectLiteralExpression Runnable -> USimpleNameReferenceExpression (identifier = Runnable) - read -> UAnnotationMethod (name = read) + read -> UMethod (name = read) Int -> USimpleNameReferenceExpression (identifier = Int) - run -> UAnnotationMethod (name = run) -withErr -> UAnnotationMethod (name = withErr) + run -> UMethod (name = run) +withErr -> UMethod (name = withErr) runnable -> ULocalVariable (name = runnable) object -> UastEmptyExpression Runnable -> null diff --git a/plugins/uast-kotlin/testData/Anonymous.log.txt b/plugins/uast-kotlin/testData/Anonymous.log.txt index b20d0a5fe3a..2a142614241 100644 --- a/plugins/uast-kotlin/testData/Anonymous.log.txt +++ b/plugins/uast-kotlin/testData/Anonymous.log.txt @@ -2,15 +2,15 @@ UFile (package = ) UImportStatement (isOnDemand = false) UImportStatement (isOnDemand = false) UClass (name = AnonymousKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UBlockExpression UDeclarationsExpression ULocalVariable (name = runnable) UObjectLiteralExpression UClass (name = null) - UAnnotationMethod (name = run) + UMethod (name = run) UBlockExpression - UAnnotationMethod (name = AnonymousKt$foo$runnable$1) + UMethod (name = AnonymousKt$foo$runnable$1) UQualifiedReferenceExpression USimpleNameReferenceExpression (identifier = runnable) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) @@ -35,23 +35,23 @@ UFile (package = ) ULocalVariable (name = closeableRunnable) UObjectLiteralExpression UClass (name = null) - UAnnotationMethod (name = close) + UMethod (name = close) UBlockExpression - UAnnotationMethod (name = run) + UMethod (name = run) UBlockExpression - UAnnotationMethod (name = AnonymousKt$foo$closeableRunnable$1) + UMethod (name = AnonymousKt$foo$closeableRunnable$1) UDeclarationsExpression ULocalVariable (name = runnableIs) UObjectLiteralExpression UClass (name = null) - UAnnotationMethod (name = read) + UMethod (name = read) UBlockExpression UReturnExpression ULiteralExpression (value = 0) - UAnnotationMethod (name = run) + UMethod (name = run) UBlockExpression - UAnnotationMethod (name = AnonymousKt$foo$runnableIs$1) - UAnnotationMethod (name = withErr) + UMethod (name = AnonymousKt$foo$runnableIs$1) + UMethod (name = withErr) UBlockExpression UDeclarationsExpression ULocalVariable (name = runnable) diff --git a/plugins/uast-kotlin/testData/Assertion.values.txt b/plugins/uast-kotlin/testData/Assertion.values.txt index d51e11b7116..db956afc60a 100644 --- a/plugins/uast-kotlin/testData/Assertion.values.txt +++ b/plugins/uast-kotlin/testData/Assertion.values.txt @@ -1,6 +1,6 @@ UFile (package = ) [public final class AssertionKt {...] UClass (name = AssertionKt) [public final class AssertionKt {...}] - UAnnotationMethod (name = foo) [public static final fun foo() : java.lang.String {...}] + UMethod (name = foo) [public static final fun foo() : java.lang.String {...}] UBlockExpression [{...}] = Nothing UDeclarationsExpression [var s: java.lang.String = "Not Null"] = Undetermined ULocalVariable (name = s) [var s: java.lang.String = "Not Null"] diff --git a/plugins/uast-kotlin/testData/Assertion.values.txt.183 b/plugins/uast-kotlin/testData/Assertion.values.txt.183 deleted file mode 100644 index d51e11b7116..00000000000 --- a/plugins/uast-kotlin/testData/Assertion.values.txt.183 +++ /dev/null @@ -1,10 +0,0 @@ -UFile (package = ) [public final class AssertionKt {...] - UClass (name = AssertionKt) [public final class AssertionKt {...}] - UAnnotationMethod (name = foo) [public static final fun foo() : java.lang.String {...}] - UBlockExpression [{...}] = Nothing - UDeclarationsExpression [var s: java.lang.String = "Not Null"] = Undetermined - ULocalVariable (name = s) [var s: java.lang.String = "Not Null"] - ULiteralExpression (value = "Not Null") ["Not Null"] = "Not Null" - UReturnExpression [return s!!] = Nothing - UPostfixExpression (operator = !!) [s!!] = (var s = "Not Null") - USimpleNameReferenceExpression (identifier = s) [s] = (var s = "Not Null") diff --git a/plugins/uast-kotlin/testData/ClassAnnotation.altlog.txt b/plugins/uast-kotlin/testData/ClassAnnotation.altlog.txt index d39b7977da0..5153489ad5d 100644 --- a/plugins/uast-kotlin/testData/ClassAnnotation.altlog.txt +++ b/plugins/uast-kotlin/testData/ClassAnnotation.altlog.txt @@ -8,7 +8,7 @@ [1]:[UIdentifier (Identifier (A))] [1]:[UClass (name = MyAnnotation)] [1]:[UIdentifier (Identifier (MyAnnotation))] - [1]:[UDeclarationsExpression] + [1]:[UMethod (name = MyAnnotation)] [1]:[UDeclarationsExpression] [1]:[UAnnotationMethod (name = text)] [1]:[UIdentifier (Identifier (text))] diff --git a/plugins/uast-kotlin/testData/ClassAnnotation.log.txt b/plugins/uast-kotlin/testData/ClassAnnotation.log.txt index 78f94912a65..fce8469ccd1 100644 --- a/plugins/uast-kotlin/testData/ClassAnnotation.log.txt +++ b/plugins/uast-kotlin/testData/ClassAnnotation.log.txt @@ -1,7 +1,7 @@ UFile (package = ) UClass (name = A) UAnnotation (fqName = null) - UAnnotationMethod (name = A) + UMethod (name = A) UClass (name = MyAnnotation) UAnnotationMethod (name = text) UClass (name = B) @@ -10,21 +10,21 @@ UFile (package = ) ULiteralExpression (value = "class") UField (name = Companion) UAnnotation (fqName = null) - UAnnotationMethod (name = B) + UMethod (name = B) UClass (name = InB) UAnnotation (fqName = MyAnnotation) UNamedExpression (name = text) ULiteralExpression (value = "inB class") - UAnnotationMethod (name = InB) + UMethod (name = InB) UClass (name = Companion) UAnnotation (fqName = MyAnnotation) UNamedExpression (name = text) ULiteralExpression (value = "companion") - UAnnotationMethod (name = Companion) + UMethod (name = Companion) UClass (name = Obj) UAnnotation (fqName = MyAnnotation) UNamedExpression (name = text) ULiteralExpression (value = "object") UField (name = INSTANCE) UAnnotation (fqName = null) - UAnnotationMethod (name = Obj) + UMethod (name = Obj) diff --git a/plugins/uast-kotlin/testData/ConstructorDelegate.log.txt b/plugins/uast-kotlin/testData/ConstructorDelegate.log.txt index 4f9eccfebf3..8bf1fc9d014 100644 --- a/plugins/uast-kotlin/testData/ConstructorDelegate.log.txt +++ b/plugins/uast-kotlin/testData/ConstructorDelegate.log.txt @@ -1,6 +1,6 @@ UFile (package = ) UClass (name = ConstructorDelegateKt) - UAnnotationMethod (name = createBase) + UMethod (name = createBase) UParameter (name = i) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -10,18 +10,18 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = , resolvesTo = BaseImpl) USimpleNameReferenceExpression (identifier = i) UClass (name = Base) - UAnnotationMethod (name = print) + UMethod (name = print) UClass (name = BaseImpl) UField (name = x) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = print) + UMethod (name = print) UBlockExpression UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) UIdentifier (Identifier (print)) USimpleNameReferenceExpression (identifier = print, resolvesTo = null) USimpleNameReferenceExpression (identifier = x) - UAnnotationMethod (name = getX) - UAnnotationMethod (name = BaseImpl) + UMethod (name = getX) + UMethod (name = BaseImpl) UParameter (name = x) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UClass (name = Derived) @@ -34,14 +34,14 @@ UFile (package = ) UExpressionList (super_delegation) UTypeReferenceExpression (name = java.lang.CharSequence) ULiteralExpression (value = "abc") - UAnnotationMethod (name = Derived) + UMethod (name = Derived) UParameter (name = b) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = getLength) - UAnnotationMethod (name = get) + UMethod (name = getLength) + UMethod (name = get) UParameter (name = index) UAnnotation (fqName = null) - UAnnotationMethod (name = subSequence) + UMethod (name = subSequence) UParameter (name = startIndex) UAnnotation (fqName = null) UParameter (name = endIndex) diff --git a/plugins/uast-kotlin/testData/Constructors.identifiers.txt b/plugins/uast-kotlin/testData/Constructors.identifiers.txt index 48074656b4e..5ed4bcca246 100644 --- a/plugins/uast-kotlin/testData/Constructors.identifiers.txt +++ b/plugins/uast-kotlin/testData/Constructors.identifiers.txt @@ -1,7 +1,7 @@ A -> UClass (name = A) str -> UParameter (name = str) String -> USimpleNameReferenceExpression (identifier = String) -constructor -> UAnnotationMethod (name = A) +constructor -> UMethod (name = A) i -> UParameter (name = i) Int -> USimpleNameReferenceExpression (identifier = Int) this -> UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) @@ -11,7 +11,7 @@ AWithInit -> UClass (name = AWithInit) str -> UParameter (name = str) String -> USimpleNameReferenceExpression (identifier = String) println -> UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) -constructor -> UAnnotationMethod (name = AWithInit) +constructor -> UMethod (name = AWithInit) i -> UParameter (name = i) Int -> USimpleNameReferenceExpression (identifier = Int) this -> UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) @@ -22,7 +22,7 @@ str -> UParameter (name = str) String -> USimpleNameReferenceExpression (identifier = String) println -> UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) println -> UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) -constructor -> UAnnotationMethod (name = AWith2Init) +constructor -> UMethod (name = AWith2Init) i -> UParameter (name = i) Int -> USimpleNameReferenceExpression (identifier = Int) this -> UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) @@ -34,14 +34,14 @@ AOnlyInit -> UClass (name = AOnlyInit) AWithSecondary -> UClass (name = AWithSecondary) a -> UField (name = a) String -> USimpleNameReferenceExpression (identifier = String) -constructor -> UAnnotationMethod (name = AWithSecondary) +constructor -> UMethod (name = AWithSecondary) i -> UParameter (name = i) Int -> USimpleNameReferenceExpression (identifier = Int) a -> USimpleNameReferenceExpression (identifier = a) = -> USimpleNameReferenceExpression (identifier = =) i -> USimpleNameReferenceExpression (identifier = i) toString -> UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) -constructor -> UAnnotationMethod (name = AWithSecondary) +constructor -> UMethod (name = AWithSecondary) s -> UParameter (name = s) String -> USimpleNameReferenceExpression (identifier = String) a -> USimpleNameReferenceExpression (identifier = a) @@ -51,14 +51,14 @@ AWithSecondaryInit -> UClass (name = AWithSecondaryInit) a -> UField (name = a) String -> USimpleNameReferenceExpression (identifier = String) println -> UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) -constructor -> UAnnotationMethod (name = AWithSecondaryInit) +constructor -> UMethod (name = AWithSecondaryInit) i -> UParameter (name = i) Int -> USimpleNameReferenceExpression (identifier = Int) a -> USimpleNameReferenceExpression (identifier = a) = -> USimpleNameReferenceExpression (identifier = =) i -> USimpleNameReferenceExpression (identifier = i) toString -> UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) -constructor -> UAnnotationMethod (name = AWithSecondaryInit) +constructor -> UMethod (name = AWithSecondaryInit) s -> UParameter (name = s) String -> USimpleNameReferenceExpression (identifier = String) a -> USimpleNameReferenceExpression (identifier = a) diff --git a/plugins/uast-kotlin/testData/Constructors.log.txt b/plugins/uast-kotlin/testData/Constructors.log.txt index ccb3ba97420..198f7e53b44 100644 --- a/plugins/uast-kotlin/testData/Constructors.log.txt +++ b/plugins/uast-kotlin/testData/Constructors.log.txt @@ -2,11 +2,11 @@ UFile (package = ) UClass (name = A) UField (name = str) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = getStr) - UAnnotationMethod (name = A) + UMethod (name = getStr) + UMethod (name = A) UParameter (name = str) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = A) + UMethod (name = A) UParameter (name = i) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -21,8 +21,8 @@ UFile (package = ) UClass (name = AWithInit) UField (name = str) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = getStr) - UAnnotationMethod (name = AWithInit) + UMethod (name = getStr) + UMethod (name = AWithInit) UParameter (name = str) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -30,7 +30,7 @@ UFile (package = ) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) UIdentifier (Identifier (println)) USimpleNameReferenceExpression (identifier = println, resolvesTo = null) - UAnnotationMethod (name = AWithInit) + UMethod (name = AWithInit) UParameter (name = i) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -45,8 +45,8 @@ UFile (package = ) UClass (name = AWith2Init) UField (name = str) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = getStr) - UAnnotationMethod (name = AWith2Init) + UMethod (name = getStr) + UMethod (name = AWith2Init) UParameter (name = str) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -60,7 +60,7 @@ UFile (package = ) UIdentifier (Identifier (println)) USimpleNameReferenceExpression (identifier = println, resolvesTo = null) ULiteralExpression (value = 2) - UAnnotationMethod (name = AWith2Init) + UMethod (name = AWith2Init) UParameter (name = i) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -73,7 +73,7 @@ UFile (package = ) UIdentifier (Identifier (toString)) USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) UClass (name = AOnlyInit) - UAnnotationMethod (name = AOnlyInit) + UMethod (name = AOnlyInit) UBlockExpression UBlockExpression UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) @@ -88,11 +88,11 @@ UFile (package = ) UClass (name = AWithSecondary) UField (name = a) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = getA) - UAnnotationMethod (name = setA) + UMethod (name = getA) + UMethod (name = setA) UParameter (name = p) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = AWithSecondary) + UMethod (name = AWithSecondary) UParameter (name = i) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -106,7 +106,7 @@ UFile (package = ) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) UIdentifier (Identifier (toString)) USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) - UAnnotationMethod (name = AWithSecondary) + UMethod (name = AWithSecondary) UParameter (name = s) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -119,11 +119,11 @@ UFile (package = ) UClass (name = AWithSecondaryInit) UField (name = a) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = getA) - UAnnotationMethod (name = setA) + UMethod (name = getA) + UMethod (name = setA) UParameter (name = p) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = AWithSecondaryInit) + UMethod (name = AWithSecondaryInit) UParameter (name = i) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -141,7 +141,7 @@ UFile (package = ) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) UIdentifier (Identifier (toString)) USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) - UAnnotationMethod (name = AWithSecondaryInit) + UMethod (name = AWithSecondaryInit) UParameter (name = s) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression diff --git a/plugins/uast-kotlin/testData/CycleInTypeParameters.types.txt b/plugins/uast-kotlin/testData/CycleInTypeParameters.types.txt index 15ec7cc8522..1dad6756ecc 100644 --- a/plugins/uast-kotlin/testData/CycleInTypeParameters.types.txt +++ b/plugins/uast-kotlin/testData/CycleInTypeParameters.types.txt @@ -5,6 +5,6 @@ UFile (package = ) [public final class CycleInTypeParametersKt {...] UBinaryExpressionWithType [null as? Device] : PsiType:Device ULiteralExpression (value = null) [null] : PsiType:Void UTypeReferenceExpression (name = Device) [Device] - UAnnotationMethod (name = getA) [public static final fun getA() : Device = UastEmptyExpression] + UMethod (name = getA) [public static final fun getA() : Device = UastEmptyExpression] UClass (name = Device) [public final class Device {...}] - UAnnotationMethod (name = Device) [public fun Device() = UastEmptyExpression] + UMethod (name = Device) [public fun Device() = UastEmptyExpression] diff --git a/plugins/uast-kotlin/testData/DefaultImpls.log.txt b/plugins/uast-kotlin/testData/DefaultImpls.log.txt index e44f03f787f..571591722f8 100644 --- a/plugins/uast-kotlin/testData/DefaultImpls.log.txt +++ b/plugins/uast-kotlin/testData/DefaultImpls.log.txt @@ -1,8 +1,8 @@ UFile (package = ) UClass (name = Foo) - UAnnotationMethod (name = bar) + UMethod (name = bar) UBlockExpression UReturnExpression ULiteralExpression (value = "Hello!") UClass (name = Baz) - UAnnotationMethod (name = Baz) + UMethod (name = Baz) diff --git a/plugins/uast-kotlin/testData/DefaultParameterValues.log.txt b/plugins/uast-kotlin/testData/DefaultParameterValues.log.txt index 66766f98fe6..11a9a0fb43d 100644 --- a/plugins/uast-kotlin/testData/DefaultParameterValues.log.txt +++ b/plugins/uast-kotlin/testData/DefaultParameterValues.log.txt @@ -1,6 +1,6 @@ UFile (package = ) UClass (name = DefaultParameterValuesKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UParameter (name = a) UAnnotation (fqName = org.jetbrains.annotations.NotNull) ULiteralExpression (value = 1) diff --git a/plugins/uast-kotlin/testData/Delegate.log.txt b/plugins/uast-kotlin/testData/Delegate.log.txt index 42cd7abe2e0..22484ddcf1f 100644 --- a/plugins/uast-kotlin/testData/Delegate.log.txt +++ b/plugins/uast-kotlin/testData/Delegate.log.txt @@ -6,10 +6,10 @@ UFile (package = ) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UField (name = z) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = getX) - UAnnotationMethod (name = getY) - UAnnotationMethod (name = getZ) - UAnnotationMethod (name = MyColor) + UMethod (name = getX) + UMethod (name = getY) + UMethod (name = getZ) + UMethod (name = MyColor) UParameter (name = x) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UParameter (name = y) @@ -53,7 +53,7 @@ UFile (package = ) ULiteralExpression (value = 1) ULiteralExpression (value = 2) ULiteralExpression (value = 3) - UAnnotationMethod (name = getDelegate) - UAnnotationMethod (name = getLambda) - UAnnotationMethod (name = getNonLazy) - UAnnotationMethod (name = Some) + UMethod (name = getDelegate) + UMethod (name = getLambda) + UMethod (name = getNonLazy) + UMethod (name = Some) diff --git a/plugins/uast-kotlin/testData/Delegate.values.txt b/plugins/uast-kotlin/testData/Delegate.values.txt index 90e8a9d44bb..d4d44b917ea 100644 --- a/plugins/uast-kotlin/testData/Delegate.values.txt +++ b/plugins/uast-kotlin/testData/Delegate.values.txt @@ -6,10 +6,10 @@ UFile (package = ) [public final class MyColor {...] UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] UField (name = z) [@org.jetbrains.annotations.NotNull private final var z: int] UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] - UAnnotationMethod (name = getX) [public final fun getX() : int = UastEmptyExpression] - UAnnotationMethod (name = getY) [public final fun getY() : int = UastEmptyExpression] - UAnnotationMethod (name = getZ) [public final fun getZ() : int = UastEmptyExpression] - UAnnotationMethod (name = MyColor) [public fun MyColor(@org.jetbrains.annotations.NotNull x: int, @org.jetbrains.annotations.NotNull y: int, @org.jetbrains.annotations.NotNull z: int) = UastEmptyExpression] + UMethod (name = getX) [public final fun getX() : int = UastEmptyExpression] + UMethod (name = getY) [public final fun getY() : int = UastEmptyExpression] + UMethod (name = getZ) [public final fun getZ() : int = UastEmptyExpression] + UMethod (name = MyColor) [public fun MyColor(@org.jetbrains.annotations.NotNull x: int, @org.jetbrains.annotations.NotNull y: int, @org.jetbrains.annotations.NotNull z: int) = UastEmptyExpression] UParameter (name = x) [@org.jetbrains.annotations.NotNull var x: int] UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] UParameter (name = y) [@org.jetbrains.annotations.NotNull var y: int] @@ -61,7 +61,7 @@ UFile (package = ) [public final class MyColor {...] ULiteralExpression (value = 1) [1] = 1 ULiteralExpression (value = 2) [2] = 2 ULiteralExpression (value = 3) [3] = 3 - UAnnotationMethod (name = getDelegate) [public final fun getDelegate() : MyColor = UastEmptyExpression] - UAnnotationMethod (name = getLambda) [public final fun getLambda() : kotlin.Lazy = UastEmptyExpression] - UAnnotationMethod (name = getNonLazy) [public final fun getNonLazy() : MyColor = UastEmptyExpression] - UAnnotationMethod (name = Some) [public fun Some() = UastEmptyExpression] + UMethod (name = getDelegate) [public final fun getDelegate() : MyColor = UastEmptyExpression] + UMethod (name = getLambda) [public final fun getLambda() : kotlin.Lazy = UastEmptyExpression] + UMethod (name = getNonLazy) [public final fun getNonLazy() : MyColor = UastEmptyExpression] + UMethod (name = Some) [public fun Some() = UastEmptyExpression] diff --git a/plugins/uast-kotlin/testData/DestructuringDeclaration.log.txt b/plugins/uast-kotlin/testData/DestructuringDeclaration.log.txt index 4685daf1ed9..e53cc1fcef7 100644 --- a/plugins/uast-kotlin/testData/DestructuringDeclaration.log.txt +++ b/plugins/uast-kotlin/testData/DestructuringDeclaration.log.txt @@ -1,6 +1,6 @@ UFile (package = ) UClass (name = DestructuringDeclarationKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UBlockExpression UDeclarationsExpression ULocalVariable (name = var268d4034) diff --git a/plugins/uast-kotlin/testData/Elvis.log.txt b/plugins/uast-kotlin/testData/Elvis.log.txt index 3723f39e132..ed8d2b3f964 100644 --- a/plugins/uast-kotlin/testData/Elvis.log.txt +++ b/plugins/uast-kotlin/testData/Elvis.log.txt @@ -1,16 +1,16 @@ UFile (package = ) UClass (name = ElvisKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UParameter (name = bar) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression UReturnExpression ULiteralExpression (value = null) - UAnnotationMethod (name = bar) + UMethod (name = bar) UBlockExpression UReturnExpression ULiteralExpression (value = 42) - UAnnotationMethod (name = baz) + UMethod (name = baz) UBlockExpression UReturnExpression UExpressionList (elvis) diff --git a/plugins/uast-kotlin/testData/EnumValueMembers.log.txt b/plugins/uast-kotlin/testData/EnumValueMembers.log.txt index ed0ac92f324..5c76f6d87a9 100644 --- a/plugins/uast-kotlin/testData/EnumValueMembers.log.txt +++ b/plugins/uast-kotlin/testData/EnumValueMembers.log.txt @@ -5,15 +5,15 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = Style) ULiteralExpression (value = "foo") UClass (name = null) - UAnnotationMethod (name = getExitAnimation) + UMethod (name = getExitAnimation) UBlockExpression UReturnExpression ULiteralExpression (value = "bar") - UAnnotationMethod (name = SHEET) + UMethod (name = SHEET) UField (name = value) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = getExitAnimation) - UAnnotationMethod (name = getValue) - UAnnotationMethod (name = Style) + UMethod (name = getExitAnimation) + UMethod (name = getValue) + UMethod (name = Style) UParameter (name = value) UAnnotation (fqName = org.jetbrains.annotations.NotNull) diff --git a/plugins/uast-kotlin/testData/IfStatement.log.txt b/plugins/uast-kotlin/testData/IfStatement.log.txt index 6d3415eaa13..fdce860179d 100644 --- a/plugins/uast-kotlin/testData/IfStatement.log.txt +++ b/plugins/uast-kotlin/testData/IfStatement.log.txt @@ -1,6 +1,6 @@ UFile (package = ) UClass (name = IfStatementKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UBlockExpression UDeclarationsExpression ULocalVariable (name = x) diff --git a/plugins/uast-kotlin/testData/In.values.txt b/plugins/uast-kotlin/testData/In.values.txt index 6e66dce6a43..95d1c22b191 100644 --- a/plugins/uast-kotlin/testData/In.values.txt +++ b/plugins/uast-kotlin/testData/In.values.txt @@ -1,6 +1,6 @@ UFile (package = ) [public final class InKt {...] UClass (name = InKt) [public final class InKt {...}] - UAnnotationMethod (name = foo) [public static final fun foo() : boolean {...}] + UMethod (name = foo) [public static final fun foo() : boolean {...}] UBlockExpression [{...}] = Nothing UDeclarationsExpression [var x: int = 1] = Undetermined ULocalVariable (name = x) [var x: int = 1] diff --git a/plugins/uast-kotlin/testData/InferenceInsideUnresolvedConstructor.types.txt b/plugins/uast-kotlin/testData/InferenceInsideUnresolvedConstructor.types.txt index 93ed57c58de..877b1d12428 100644 --- a/plugins/uast-kotlin/testData/InferenceInsideUnresolvedConstructor.types.txt +++ b/plugins/uast-kotlin/testData/InferenceInsideUnresolvedConstructor.types.txt @@ -1,6 +1,6 @@ UFile (package = ) [public final class InferenceInsideUnresolvedConstructorKt {...] UClass (name = InferenceInsideUnresolvedConstructorKt) [public final class InferenceInsideUnresolvedConstructorKt {...}] - UAnnotationMethod (name = getBar) [public static final fun getBar() : java.lang.Object {...}] + UMethod (name = getBar) [public static final fun getBar() : java.lang.Object {...}] UBlockExpression [{...}] UReturnExpression [return (id(42))] UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [(id(42))] @@ -10,7 +10,7 @@ UFile (package = ) [public final class InferenceInsideUnresolvedConstructorKt {. UIdentifier (Identifier (id)) [UIdentifier (Identifier (id))] USimpleNameReferenceExpression (identifier = id, resolvesTo = null) [id] : PsiType: ULiteralExpression (value = 42) [42] : PsiType:int - UAnnotationMethod (name = id) [public static final fun id(@org.jetbrains.annotations.Nullable x: T) : T {...}] + UMethod (name = id) [public static final fun id(@org.jetbrains.annotations.Nullable x: T) : T {...}] UParameter (name = x) [@org.jetbrains.annotations.Nullable var x: T] UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] UBlockExpression [{...}] diff --git a/plugins/uast-kotlin/testData/InnerClasses.altlog.txt b/plugins/uast-kotlin/testData/InnerClasses.altlog.txt index 9552409772b..b9b079346b7 100644 --- a/plugins/uast-kotlin/testData/InnerClasses.altlog.txt +++ b/plugins/uast-kotlin/testData/InnerClasses.altlog.txt @@ -2,22 +2,22 @@ [1]:[UClass (name = Foo)] [1]:[UIdentifier (Identifier (Foo))] [1]:[UExpressionList (class_body)] - [2]:[UClass (name = Bar), UAnnotationMethod (name = Bar)] + [2]:[UClass (name = Bar), UMethod (name = Bar)] [1]:[UIdentifier (Identifier (Bar))] - [1]:[UAnnotationMethod (name = Bar)] + [1]:[UMethod (name = Bar)] [1]:[UDeclarationsExpression] - [3]:[UParameter (name = a), UField (name = a), UAnnotationMethod (name = getA)] + [3]:[UParameter (name = a), UField (name = a), UMethod (name = getA)] [1]:[UIdentifier (Identifier (a))] [1]:[UTypeReferenceExpression (name = int)] [1]:[USimpleNameReferenceExpression (identifier = Int)] [1]:[UIdentifier (Identifier (Int))] - [3]:[UParameter (name = b), UField (name = b), UAnnotationMethod (name = getB)] + [3]:[UParameter (name = b), UField (name = b), UMethod (name = getB)] [1]:[UIdentifier (Identifier (b))] [1]:[UTypeReferenceExpression (name = int)] [1]:[USimpleNameReferenceExpression (identifier = Int)] [1]:[UIdentifier (Identifier (Int))] [1]:[UExpressionList (class_body)] - [1]:[UAnnotationMethod (name = getAPlusB)] + [1]:[UMethod (name = getAPlusB)] [1]:[UIdentifier (Identifier (getAPlusB))] [1]:[UDeclarationsExpression] [1]:[UBinaryExpression (operator = +)] @@ -30,7 +30,7 @@ [1]:[UClass (name = Baz)] [1]:[UIdentifier (Identifier (Baz))] [1]:[UExpressionList (class_body)] - [1]:[UAnnotationMethod (name = doNothing)] + [1]:[UMethod (name = doNothing)] [1]:[UIdentifier (Identifier (doNothing))] [1]:[UDeclarationsExpression] [1]:[USimpleNameReferenceExpression (identifier = Unit)] diff --git a/plugins/uast-kotlin/testData/InnerClasses.log.txt b/plugins/uast-kotlin/testData/InnerClasses.log.txt index 3cdc92aea45..af986760bbf 100644 --- a/plugins/uast-kotlin/testData/InnerClasses.log.txt +++ b/plugins/uast-kotlin/testData/InnerClasses.log.txt @@ -1,27 +1,27 @@ UFile (package = ) UClass (name = Foo) - UAnnotationMethod (name = Foo) + UMethod (name = Foo) UClass (name = Bar) UField (name = a) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UField (name = b) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = getAPlusB) + UMethod (name = getAPlusB) UBlockExpression UReturnExpression UBinaryExpression (operator = +) USimpleNameReferenceExpression (identifier = a) USimpleNameReferenceExpression (identifier = b) - UAnnotationMethod (name = getA) - UAnnotationMethod (name = getB) - UAnnotationMethod (name = Bar) + UMethod (name = getA) + UMethod (name = getB) + UMethod (name = Bar) UParameter (name = a) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UParameter (name = b) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UClass (name = Baz) - UAnnotationMethod (name = doNothing) + UMethod (name = doNothing) UBlockExpression UReturnExpression USimpleNameReferenceExpression (identifier = Unit) - UAnnotationMethod (name = Baz) + UMethod (name = Baz) diff --git a/plugins/uast-kotlin/testData/InnerClasses.splog.txt b/plugins/uast-kotlin/testData/InnerClasses.splog.txt index c739be3bfab..6933960e5dc 100644 --- a/plugins/uast-kotlin/testData/InnerClasses.splog.txt +++ b/plugins/uast-kotlin/testData/InnerClasses.splog.txt @@ -1,9 +1,9 @@ UFile (package = ) UClass (name = Foo) UClass (name = Bar) - UAnnotationMethod (name = Bar) + UMethod (name = Bar) UField (name = a) UField (name = b) - UAnnotationMethod (name = getAPlusB) + UMethod (name = getAPlusB) UClass (name = Baz) - UAnnotationMethod (name = doNothing) + UMethod (name = doNothing) diff --git a/plugins/uast-kotlin/testData/InnerNonFixedTypeVariable.types.txt b/plugins/uast-kotlin/testData/InnerNonFixedTypeVariable.types.txt index 0f3cc47391f..20f2deb7508 100644 --- a/plugins/uast-kotlin/testData/InnerNonFixedTypeVariable.types.txt +++ b/plugins/uast-kotlin/testData/InnerNonFixedTypeVariable.types.txt @@ -1,6 +1,6 @@ UFile (package = ) [public final class InnerNonFixedTypeVariableKt {...] UClass (name = InnerNonFixedTypeVariableKt) [public final class InnerNonFixedTypeVariableKt {...}] - UAnnotationMethod (name = test) [public static final fun test(@org.jetbrains.annotations.NotNull list: java.util.List) : void {...}] + UMethod (name = test) [public static final fun test(@org.jetbrains.annotations.NotNull list: java.util.List) : void {...}] UParameter (name = list) [@org.jetbrains.annotations.NotNull var list: java.util.List] UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] UBlockExpression [{...}] : PsiType: @@ -19,4 +19,4 @@ UFile (package = ) [public final class InnerNonFixedTypeVariableKt {...] ULambdaExpression [{ ...}] : PsiType:Function0 UBlockExpression [{...}] UClass (name = Some) [public final class Some {...}] - UAnnotationMethod (name = Some) [public fun Some() = UastEmptyExpression] + UMethod (name = Some) [public fun Some() = UastEmptyExpression] diff --git a/plugins/uast-kotlin/testData/LambdaReturn.log.txt b/plugins/uast-kotlin/testData/LambdaReturn.log.txt index 27fdd20f748..39d0e1e7366 100644 --- a/plugins/uast-kotlin/testData/LambdaReturn.log.txt +++ b/plugins/uast-kotlin/testData/LambdaReturn.log.txt @@ -1,6 +1,6 @@ UFile (package = org.jetbrains.uast.kotlin) UClass (name = LambdaReturnKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UBlockExpression UDeclarationsExpression ULocalVariable (name = lam1) @@ -130,7 +130,7 @@ UFile (package = org.jetbrains.uast.kotlin) UIdentifier (Identifier (listOf)) USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) ULiteralExpression (value = 1) - UAnnotationMethod (name = bar) + UMethod (name = bar) UParameter (name = lmbd) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression diff --git a/plugins/uast-kotlin/testData/Lambdas.log.txt b/plugins/uast-kotlin/testData/Lambdas.log.txt index b87a97a8480..256e1d25f80 100644 --- a/plugins/uast-kotlin/testData/Lambdas.log.txt +++ b/plugins/uast-kotlin/testData/Lambdas.log.txt @@ -1,7 +1,7 @@ UFile (package = ) UImportStatement (isOnDemand = false) UClass (name = LambdasKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UBlockExpression UQualifiedReferenceExpression UQualifiedReferenceExpression @@ -20,7 +20,7 @@ UFile (package = ) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) UIdentifier (Identifier (isEmpty)) USimpleNameReferenceExpression (identifier = isEmpty, resolvesTo = null) - UAnnotationMethod (name = doSelectItem) + UMethod (name = doSelectItem) UParameter (name = selectItemFunction) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression diff --git a/plugins/uast-kotlin/testData/LocalDeclarations.altlog.txt b/plugins/uast-kotlin/testData/LocalDeclarations.altlog.txt index 2eeed9b522c..8795145472e 100644 --- a/plugins/uast-kotlin/testData/LocalDeclarations.altlog.txt +++ b/plugins/uast-kotlin/testData/LocalDeclarations.altlog.txt @@ -1,5 +1,5 @@ [2]:[UFile (package = ), UClass (name = LocalDeclarationsKt)] - [1]:[UAnnotationMethod (name = foo)] + [1]:[UMethod (name = foo)] [1]:[UIdentifier (Identifier (foo))] [1]:[UDeclarationsExpression] [1]:[UTypeReferenceExpression (name = boolean)] diff --git a/plugins/uast-kotlin/testData/LocalDeclarations.identifiers.txt b/plugins/uast-kotlin/testData/LocalDeclarations.identifiers.txt index 90899dfe053..e7659615439 100644 --- a/plugins/uast-kotlin/testData/LocalDeclarations.identifiers.txt +++ b/plugins/uast-kotlin/testData/LocalDeclarations.identifiers.txt @@ -1,4 +1,4 @@ -foo -> UAnnotationMethod (name = foo) +foo -> UMethod (name = foo) Boolean -> USimpleNameReferenceExpression (identifier = Boolean) Local -> UClass (name = Local) bar -> ULambdaExpression diff --git a/plugins/uast-kotlin/testData/LocalDeclarations.log.txt b/plugins/uast-kotlin/testData/LocalDeclarations.log.txt index 013b37226b2..631ce793b8a 100644 --- a/plugins/uast-kotlin/testData/LocalDeclarations.log.txt +++ b/plugins/uast-kotlin/testData/LocalDeclarations.log.txt @@ -1,10 +1,10 @@ UFile (package = ) UClass (name = LocalDeclarationsKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UBlockExpression UDeclarationsExpression UClass (name = Local) - UAnnotationMethod (name = LocalDeclarationsKt$foo$Local) + UMethod (name = LocalDeclarationsKt$foo$Local) UDeclarationsExpression UVariable (name = bar) ULambdaExpression @@ -32,7 +32,7 @@ UFile (package = ) UClass (name = LocalObject) UField (name = INSTANCE) UAnnotation (fqName = null) - UAnnotationMethod (name = LocalDeclarationsKt$foo$LocalObject) + UMethod (name = LocalDeclarationsKt$foo$LocalObject) UReturnExpression UBinaryExpression (operator = ==) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) diff --git a/plugins/uast-kotlin/testData/LocalDeclarations.types.txt b/plugins/uast-kotlin/testData/LocalDeclarations.types.txt index a26bc6f2238..dbe1b3a2584 100644 --- a/plugins/uast-kotlin/testData/LocalDeclarations.types.txt +++ b/plugins/uast-kotlin/testData/LocalDeclarations.types.txt @@ -1,10 +1,10 @@ UFile (package = ) [public final class LocalDeclarationsKt {...] UClass (name = LocalDeclarationsKt) [public final class LocalDeclarationsKt {...}] - UAnnotationMethod (name = foo) [public static final fun foo() : boolean {...}] + UMethod (name = foo) [public static final fun foo() : boolean {...}] UBlockExpression [{...}] : PsiType:Void UDeclarationsExpression [public static final class Local {...}] UClass (name = Local) [public static final class Local {...}] - UAnnotationMethod (name = LocalDeclarationsKt$foo$Local) [public fun LocalDeclarationsKt$foo$Local() = UastEmptyExpression] + UMethod (name = LocalDeclarationsKt$foo$Local) [public fun LocalDeclarationsKt$foo$Local() = UastEmptyExpression] UDeclarationsExpression [var bar: = fun () {...}] UVariable (name = bar) [var bar: = fun () {...}] ULambdaExpression [fun () {...}] @@ -32,7 +32,7 @@ UFile (package = ) [public final class LocalDeclarationsKt {...] UClass (name = LocalObject) [public static final class LocalObject {...}] UField (name = INSTANCE) [@null public static final var INSTANCE: LocalDeclarationsKt.foo.LocalObject] UAnnotation (fqName = null) [@null] - UAnnotationMethod (name = LocalDeclarationsKt$foo$LocalObject) [private fun LocalDeclarationsKt$foo$LocalObject() = UastEmptyExpression] + UMethod (name = LocalDeclarationsKt$foo$LocalObject) [private fun LocalDeclarationsKt$foo$LocalObject() = UastEmptyExpression] UReturnExpression [return bar() == ()] : PsiType:Void UBinaryExpression (operator = ==) [bar() == ()] : PsiType:boolean UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [bar()] : PsiType: diff --git a/plugins/uast-kotlin/testData/LocalDeclarations.values.txt b/plugins/uast-kotlin/testData/LocalDeclarations.values.txt index 4cb4472a3cf..eae5032907f 100644 --- a/plugins/uast-kotlin/testData/LocalDeclarations.values.txt +++ b/plugins/uast-kotlin/testData/LocalDeclarations.values.txt @@ -1,10 +1,10 @@ UFile (package = ) [public final class LocalDeclarationsKt {...] UClass (name = LocalDeclarationsKt) [public final class LocalDeclarationsKt {...}] - UAnnotationMethod (name = foo) [public static final fun foo() : boolean {...}] + UMethod (name = foo) [public static final fun foo() : boolean {...}] UBlockExpression [{...}] = Nothing UDeclarationsExpression [public static final class Local {...}] = Undetermined UClass (name = Local) [public static final class Local {...}] - UAnnotationMethod (name = LocalDeclarationsKt$foo$Local) [public fun LocalDeclarationsKt$foo$Local() = UastEmptyExpression] + UMethod (name = LocalDeclarationsKt$foo$Local) [public fun LocalDeclarationsKt$foo$Local() = UastEmptyExpression] UDeclarationsExpression [var bar: = fun () {...}] = Undetermined UVariable (name = bar) [var bar: = fun () {...}] ULambdaExpression [fun () {...}] = Undetermined @@ -32,7 +32,7 @@ UFile (package = ) [public final class LocalDeclarationsKt {...] UClass (name = LocalObject) [public static final class LocalObject {...}] UField (name = INSTANCE) [@null public static final var INSTANCE: LocalDeclarationsKt.foo.LocalObject] UAnnotation (fqName = null) [@null] - UAnnotationMethod (name = LocalDeclarationsKt$foo$LocalObject) [private fun LocalDeclarationsKt$foo$LocalObject() = UastEmptyExpression] + UMethod (name = LocalDeclarationsKt$foo$LocalObject) [private fun LocalDeclarationsKt$foo$LocalObject() = UastEmptyExpression] UReturnExpression [return bar() == ()] = Nothing UBinaryExpression (operator = ==) [bar() == ()] = Undetermined UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [bar()] = external bar()() diff --git a/plugins/uast-kotlin/testData/LocalVariableWithAnnotation.log.txt b/plugins/uast-kotlin/testData/LocalVariableWithAnnotation.log.txt index b3033c06211..0576c834e75 100644 --- a/plugins/uast-kotlin/testData/LocalVariableWithAnnotation.log.txt +++ b/plugins/uast-kotlin/testData/LocalVariableWithAnnotation.log.txt @@ -1,6 +1,6 @@ UFile (package = ) UClass (name = LocalVariableWithAnnotationKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UBlockExpression UDeclarationsExpression ULocalVariable (name = bar) diff --git a/plugins/uast-kotlin/testData/ParameterPropertyWithAnnotation.altlog.txt b/plugins/uast-kotlin/testData/ParameterPropertyWithAnnotation.altlog.txt index 8e8944d919c..594d3be75d5 100644 --- a/plugins/uast-kotlin/testData/ParameterPropertyWithAnnotation.altlog.txt +++ b/plugins/uast-kotlin/testData/ParameterPropertyWithAnnotation.altlog.txt @@ -9,11 +9,11 @@ [1]:[UIdentifier (Identifier (MyAnnotation4))] [1]:[UClass (name = MyAnnotation5)] [1]:[UIdentifier (Identifier (MyAnnotation5))] - [2]:[UClass (name = Test1), UAnnotationMethod (name = Test1)] + [2]:[UClass (name = Test1), UMethod (name = Test1)] [1]:[UIdentifier (Identifier (Test1))] - [1]:[UAnnotationMethod (name = Test1)] + [1]:[UMethod (name = Test1)] [1]:[UDeclarationsExpression] - [4]:[UParameter (name = bar), UField (name = bar), UAnnotationMethod (name = getBar), UAnnotationMethod (name = setBar)] + [4]:[UParameter (name = bar), UField (name = bar), UMethod (name = getBar), UMethod (name = setBar)] [1]:[UAnnotation (fqName = MyAnnotation)] [1]:[[!] UnknownKotlinExpression (CONSTRUCTOR_CALLEE)] [1]:[UTypeReferenceExpression (name = MyAnnotation)] @@ -23,11 +23,11 @@ [1]:[UTypeReferenceExpression (name = int)] [1]:[USimpleNameReferenceExpression (identifier = Int)] [1]:[UIdentifier (Identifier (Int))] - [2]:[UClass (name = Test2), UAnnotationMethod (name = Test2)] + [2]:[UClass (name = Test2), UMethod (name = Test2)] [1]:[UIdentifier (Identifier (Test2))] - [1]:[UAnnotationMethod (name = Test2)] + [1]:[UMethod (name = Test2)] [1]:[UDeclarationsExpression] - [4]:[UParameter (name = bar), UField (name = bar), UAnnotationMethod (name = getBar), UAnnotationMethod (name = setBar)] + [4]:[UParameter (name = bar), UField (name = bar), UMethod (name = getBar), UMethod (name = setBar)] [1]:[UAnnotation (fqName = MyAnnotation)] [1]:[[!] UnknownKotlinExpression (CONSTRUCTOR_CALLEE)] [1]:[UTypeReferenceExpression (name = MyAnnotation)] diff --git a/plugins/uast-kotlin/testData/ParameterPropertyWithAnnotation.log.txt b/plugins/uast-kotlin/testData/ParameterPropertyWithAnnotation.log.txt index 671ec7fa53a..796aeecb8c7 100644 --- a/plugins/uast-kotlin/testData/ParameterPropertyWithAnnotation.log.txt +++ b/plugins/uast-kotlin/testData/ParameterPropertyWithAnnotation.log.txt @@ -7,11 +7,11 @@ UFile (package = ) UClass (name = Test1) UField (name = bar) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = getBar) - UAnnotationMethod (name = setBar) + UMethod (name = getBar) + UMethod (name = setBar) UParameter (name = p) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = Test1) + UMethod (name = Test1) UParameter (name = bar) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UAnnotation (fqName = MyAnnotation) @@ -19,13 +19,13 @@ UFile (package = ) UField (name = bar) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UAnnotation (fqName = MyAnnotation5) - UAnnotationMethod (name = getBar) + UMethod (name = getBar) UAnnotation (fqName = MyAnnotation) - UAnnotationMethod (name = setBar) + UMethod (name = setBar) UAnnotation (fqName = MyAnnotation2) UParameter (name = p) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UAnnotation (fqName = MyAnnotation3) - UAnnotationMethod (name = Test2) + UMethod (name = Test2) UParameter (name = bar) UAnnotation (fqName = org.jetbrains.annotations.NotNull) diff --git a/plugins/uast-kotlin/testData/ParametersDisorder.log.txt b/plugins/uast-kotlin/testData/ParametersDisorder.log.txt index b6e593547f0..e8a37796eef 100644 --- a/plugins/uast-kotlin/testData/ParametersDisorder.log.txt +++ b/plugins/uast-kotlin/testData/ParametersDisorder.log.txt @@ -1,12 +1,12 @@ UFile (package = ) UClass (name = ParametersDisorderKt) - UAnnotationMethod (name = global) + UMethod (name = global) UParameter (name = a) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UParameter (name = b) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression - UAnnotationMethod (name = withDefault) + UMethod (name = withDefault) UParameter (name = c) UAnnotation (fqName = org.jetbrains.annotations.NotNull) ULiteralExpression (value = 1) @@ -14,7 +14,7 @@ UFile (package = ) UAnnotation (fqName = org.jetbrains.annotations.NotNull) ULiteralExpression (value = "aaa") UBlockExpression - UAnnotationMethod (name = withReceiver) + UMethod (name = withReceiver) UParameter (name = $this$withReceiver) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UParameter (name = a) @@ -22,7 +22,7 @@ UFile (package = ) UParameter (name = b) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression - UAnnotationMethod (name = call) + UMethod (name = call) UBlockExpression UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) UIdentifier (Identifier (global)) @@ -138,15 +138,15 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = with2Receivers, resolvesTo = null) ULiteralExpression (value = 8) ULiteralExpression (value = 7.0) - UAnnotationMethod (name = objectLiteral) + UMethod (name = objectLiteral) UBlockExpression UObjectLiteralExpression ULiteralExpression (value = 1) ULiteralExpression (value = "foo") UClass (name = null) - UAnnotationMethod (name = ParametersDisorderKt$objectLiteral$1) + UMethod (name = ParametersDisorderKt$objectLiteral$1) UClass (name = A) - UAnnotationMethod (name = with2Receivers) + UMethod (name = with2Receivers) UParameter (name = $this$with2Receivers) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UParameter (name = a) @@ -154,9 +154,9 @@ UFile (package = ) UParameter (name = b) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression - UAnnotationMethod (name = A) + UMethod (name = A) UClass (name = Parent) - UAnnotationMethod (name = Parent) + UMethod (name = Parent) UParameter (name = a) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UParameter (name = b) diff --git a/plugins/uast-kotlin/testData/ParametersWithDefaultValues.log.txt b/plugins/uast-kotlin/testData/ParametersWithDefaultValues.log.txt index 3c196401c77..fce73abf596 100644 --- a/plugins/uast-kotlin/testData/ParametersWithDefaultValues.log.txt +++ b/plugins/uast-kotlin/testData/ParametersWithDefaultValues.log.txt @@ -1,6 +1,6 @@ UFile (package = ) UClass (name = ParametersWithDefaultValuesKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UParameter (name = a) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UParameter (name = b) diff --git a/plugins/uast-kotlin/testData/PropertyAccessors.log.txt b/plugins/uast-kotlin/testData/PropertyAccessors.log.txt index 88aefccd3ce..bfd75c247c2 100644 --- a/plugins/uast-kotlin/testData/PropertyAccessors.log.txt +++ b/plugins/uast-kotlin/testData/PropertyAccessors.log.txt @@ -1,6 +1,6 @@ UFile (package = ) UClass (name = PropertyTest) - UAnnotationMethod (name = getStringRepresentation) + UMethod (name = getStringRepresentation) UBlockExpression UReturnExpression UQualifiedReferenceExpression @@ -8,7 +8,7 @@ UFile (package = ) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) UIdentifier (Identifier (toString)) USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) - UAnnotationMethod (name = setStringRepresentation) + UMethod (name = setStringRepresentation) UParameter (name = value) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -16,8 +16,8 @@ UFile (package = ) UIdentifier (Identifier (setDataFromString)) USimpleNameReferenceExpression (identifier = setDataFromString, resolvesTo = null) USimpleNameReferenceExpression (identifier = value) - UAnnotationMethod (name = setDataFromString) + UMethod (name = setDataFromString) UParameter (name = data) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression - UAnnotationMethod (name = PropertyTest) + UMethod (name = PropertyTest) diff --git a/plugins/uast-kotlin/testData/PropertyDelegate.log.txt b/plugins/uast-kotlin/testData/PropertyDelegate.log.txt index 7fe13b894f3..42d7e5aa6fe 100644 --- a/plugins/uast-kotlin/testData/PropertyDelegate.log.txt +++ b/plugins/uast-kotlin/testData/PropertyDelegate.log.txt @@ -21,8 +21,8 @@ UFile (package = ) UBinaryExpression (operator = +) ULiteralExpression (value = 1) ULiteralExpression (value = 1) - UAnnotationMethod (name = getSdCardPath) - UAnnotationMethod (name = localPropertyTest) + UMethod (name = getSdCardPath) + UMethod (name = localPropertyTest) UBlockExpression UDeclarationsExpression ULocalVariable (name = sdCardPathLocal) @@ -33,4 +33,4 @@ UFile (package = ) UBlockExpression UReturnExpression ULiteralExpression (value = "/sdcard") - UAnnotationMethod (name = getAnnotatedDelegate) + UMethod (name = getAnnotatedDelegate) diff --git a/plugins/uast-kotlin/testData/PropertyInitializer.log.txt b/plugins/uast-kotlin/testData/PropertyInitializer.log.txt index bbb6d3b1510..0445696ef71 100644 --- a/plugins/uast-kotlin/testData/PropertyInitializer.log.txt +++ b/plugins/uast-kotlin/testData/PropertyInitializer.log.txt @@ -3,15 +3,15 @@ UFile (package = ) UField (name = withSetter) UAnnotation (fqName = org.jetbrains.annotations.NotNull) ULiteralExpression (value = "/sdcard") - UAnnotationMethod (name = getWithSetter) + UMethod (name = getWithSetter) UBlockExpression UReturnExpression USimpleNameReferenceExpression (identifier = field) - UAnnotationMethod (name = setWithSetter) + UMethod (name = setWithSetter) UParameter (name = p) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression UBinaryExpression (operator = =) USimpleNameReferenceExpression (identifier = field) USimpleNameReferenceExpression (identifier = p) - UAnnotationMethod (name = TestPropertyInitializer) + UMethod (name = TestPropertyInitializer) diff --git a/plugins/uast-kotlin/testData/PropertyInitializerWithoutSetter.log.txt b/plugins/uast-kotlin/testData/PropertyInitializerWithoutSetter.log.txt index 22d8f071181..2617618a649 100644 --- a/plugins/uast-kotlin/testData/PropertyInitializerWithoutSetter.log.txt +++ b/plugins/uast-kotlin/testData/PropertyInitializerWithoutSetter.log.txt @@ -3,10 +3,10 @@ UFile (package = ) UField (name = withoutSetter) UAnnotation (fqName = org.jetbrains.annotations.NotNull) ULiteralExpression (value = "/sdcard") - UAnnotationMethod (name = getWithoutSetter) + UMethod (name = getWithoutSetter) UBlockExpression UReturnExpression USimpleNameReferenceExpression (identifier = field) - UAnnotationMethod (name = setWithoutSetter) + UMethod (name = setWithoutSetter) UParameter (name = p) UAnnotation (fqName = org.jetbrains.annotations.NotNull) diff --git a/plugins/uast-kotlin/testData/PropertyWithAnnotation.log.txt b/plugins/uast-kotlin/testData/PropertyWithAnnotation.log.txt index 4ae00643a3b..20f5526b1c1 100644 --- a/plugins/uast-kotlin/testData/PropertyWithAnnotation.log.txt +++ b/plugins/uast-kotlin/testData/PropertyWithAnnotation.log.txt @@ -7,17 +7,17 @@ UFile (package = ) UField (name = prop3) UAnnotation (fqName = org.jetbrains.annotations.NotNull) ULiteralExpression (value = 0) - UAnnotationMethod (name = getProp1) - UAnnotationMethod (name = getProp2) + UMethod (name = getProp1) + UMethod (name = getProp2) UAnnotation (fqName = TestAnnotation) UBlockExpression UReturnExpression ULiteralExpression (value = 0) - UAnnotationMethod (name = getProp3) + UMethod (name = getProp3) UBlockExpression UReturnExpression ULiteralExpression (value = 0) - UAnnotationMethod (name = setProp3) + UMethod (name = setProp3) UAnnotation (fqName = TestAnnotation) UParameter (name = value) UAnnotation (fqName = org.jetbrains.annotations.NotNull) diff --git a/plugins/uast-kotlin/testData/QualifiedConstructorCall.log.txt b/plugins/uast-kotlin/testData/QualifiedConstructorCall.log.txt index 39959ecaf4e..ba9ce20661e 100644 --- a/plugins/uast-kotlin/testData/QualifiedConstructorCall.log.txt +++ b/plugins/uast-kotlin/testData/QualifiedConstructorCall.log.txt @@ -1,8 +1,8 @@ UFile (package = A.B.C) UClass (name = Foo) - UAnnotationMethod (name = Foo) + UMethod (name = Foo) UClass (name = Bar) - UAnnotationMethod (name = getFoo) + UMethod (name = getFoo) UBlockExpression UReturnExpression UQualifiedReferenceExpression @@ -14,4 +14,4 @@ UFile (package = A.B.C) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (Foo)) USimpleNameReferenceExpression (identifier = , resolvesTo = Foo) - UAnnotationMethod (name = Bar) + UMethod (name = Bar) diff --git a/plugins/uast-kotlin/testData/ReceiverFun.log.txt b/plugins/uast-kotlin/testData/ReceiverFun.log.txt index df029758e47..60748825fcf 100644 --- a/plugins/uast-kotlin/testData/ReceiverFun.log.txt +++ b/plugins/uast-kotlin/testData/ReceiverFun.log.txt @@ -1,6 +1,6 @@ UFile (package = ) UClass (name = ReceiverFunKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UParameter (name = $this$foo) UAnnotation (fqName = MyReceiverAnnotation) UAnnotation (fqName = org.jetbrains.annotations.NotNull) diff --git a/plugins/uast-kotlin/testData/Simple.log.txt b/plugins/uast-kotlin/testData/Simple.log.txt index 93cb0f0bb05..f352eb5b902 100644 --- a/plugins/uast-kotlin/testData/Simple.log.txt +++ b/plugins/uast-kotlin/testData/Simple.log.txt @@ -3,11 +3,11 @@ UFile (package = ) UField (name = property) UAnnotation (fqName = org.jetbrains.annotations.NotNull) ULiteralExpression (value = "Mary") - UAnnotationMethod (name = method) + UMethod (name = method) UBlockExpression UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) UIdentifier (Identifier (println)) USimpleNameReferenceExpression (identifier = println, resolvesTo = null) ULiteralExpression (value = "Hello, world!") - UAnnotationMethod (name = getProperty) - UAnnotationMethod (name = Simple) + UMethod (name = getProperty) + UMethod (name = Simple) diff --git a/plugins/uast-kotlin/testData/Simple.values.txt b/plugins/uast-kotlin/testData/Simple.values.txt index d44f36b0770..24a7ff0f4aa 100644 --- a/plugins/uast-kotlin/testData/Simple.values.txt +++ b/plugins/uast-kotlin/testData/Simple.values.txt @@ -3,11 +3,11 @@ UFile (package = ) [public final class Simple {...] UField (name = property) [@org.jetbrains.annotations.NotNull private final var property: java.lang.String = "Mary"] UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] ULiteralExpression (value = "Mary") ["Mary"] = "Mary" - UAnnotationMethod (name = method) [public final fun method() : void {...}] + UMethod (name = method) [public final fun method() : void {...}] UBlockExpression [{...}] = external println("Hello, world!")("Hello, world!") UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println("Hello, world!")] = external println("Hello, world!")("Hello, world!") UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println("Hello, world!")("Hello, world!") ULiteralExpression (value = "Hello, world!") ["Hello, world!"] = "Hello, world!" - UAnnotationMethod (name = getProperty) [public final fun getProperty() : java.lang.String = UastEmptyExpression] - UAnnotationMethod (name = Simple) [public fun Simple() = UastEmptyExpression] + UMethod (name = getProperty) [public final fun getProperty() : java.lang.String = UastEmptyExpression] + UMethod (name = Simple) [public fun Simple() = UastEmptyExpression] diff --git a/plugins/uast-kotlin/testData/SimpleAnnotated.identifiers.txt b/plugins/uast-kotlin/testData/SimpleAnnotated.identifiers.txt index 9e2cb188e0c..797287d42a4 100644 --- a/plugins/uast-kotlin/testData/SimpleAnnotated.identifiers.txt +++ b/plugins/uast-kotlin/testData/SimpleAnnotated.identifiers.txt @@ -1,6 +1,6 @@ SimpleAnnotated -> UClass (name = SimpleAnnotated) Suppress -> UAnnotation (fqName = kotlin.Suppress) -method -> UAnnotationMethod (name = method) +method -> UMethod (name = method) println -> UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) kotlin -> USimpleNameReferenceExpression (identifier = kotlin) SinceKotlin -> UAnnotation (fqName = kotlin.SinceKotlin) diff --git a/plugins/uast-kotlin/testData/SimpleScript.log.txt b/plugins/uast-kotlin/testData/SimpleScript.log.txt index 89ef5ba5c51..af6b6f03ba0 100644 --- a/plugins/uast-kotlin/testData/SimpleScript.log.txt +++ b/plugins/uast-kotlin/testData/SimpleScript.log.txt @@ -1,6 +1,6 @@ UFile (package = ) UClass (name = SimpleScript) - UAnnotationMethod (name = getBarOrNull) + UMethod (name = getBarOrNull) UParameter (name = flag) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -12,10 +12,10 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = , resolvesTo = Bar) ULiteralExpression (value = 42) ULiteralExpression (value = null) - UAnnotationMethod (name = main) + UMethod (name = main) UParameter (name = p) UAnnotation (fqName = null) - UAnnotationMethod (name = SimpleScript) + UMethod (name = SimpleScript) UParameter (name = p) UAnnotation (fqName = null) UBlockExpression @@ -37,18 +37,18 @@ UFile (package = ) ULiteralExpression (value = 0) UField (name = a) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = getB) - UAnnotationMethod (name = getAPlusB) + UMethod (name = getB) + UMethod (name = getAPlusB) UBlockExpression UReturnExpression UBinaryExpression (operator = +) USimpleNameReferenceExpression (identifier = a) USimpleNameReferenceExpression (identifier = b) - UAnnotationMethod (name = getA) - UAnnotationMethod (name = Bar) + UMethod (name = getA) + UMethod (name = Bar) UParameter (name = a) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UClass (name = Baz) - UAnnotationMethod (name = doSomething) + UMethod (name = doSomething) UBlockExpression - UAnnotationMethod (name = Baz) + UMethod (name = Baz) diff --git a/plugins/uast-kotlin/testData/StringTemplate.log.txt b/plugins/uast-kotlin/testData/StringTemplate.log.txt index e38047dc442..1f25dbd51a5 100644 --- a/plugins/uast-kotlin/testData/StringTemplate.log.txt +++ b/plugins/uast-kotlin/testData/StringTemplate.log.txt @@ -17,7 +17,7 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = bar) ULiteralExpression (value = " ") USimpleNameReferenceExpression (identifier = baz) - UAnnotationMethod (name = getFoo) - UAnnotationMethod (name = getBar) - UAnnotationMethod (name = getBaz) - UAnnotationMethod (name = getFoobarbaz) + UMethod (name = getFoo) + UMethod (name = getBar) + UMethod (name = getBaz) + UMethod (name = getFoobarbaz) diff --git a/plugins/uast-kotlin/testData/StringTemplate.types.txt b/plugins/uast-kotlin/testData/StringTemplate.types.txt index 5fbd93d1825..01a7d9cdde5 100644 --- a/plugins/uast-kotlin/testData/StringTemplate.types.txt +++ b/plugins/uast-kotlin/testData/StringTemplate.types.txt @@ -17,7 +17,7 @@ UFile (package = ) [public final class StringTemplateKt {...] USimpleNameReferenceExpression (identifier = bar) [bar] : PsiType:String ULiteralExpression (value = " ") [" "] : PsiType:String USimpleNameReferenceExpression (identifier = baz) [baz] : PsiType:String - UAnnotationMethod (name = getFoo) [public static final fun getFoo() : java.lang.String = UastEmptyExpression] - UAnnotationMethod (name = getBar) [public static final fun getBar() : java.lang.String = UastEmptyExpression] - UAnnotationMethod (name = getBaz) [public static final fun getBaz() : java.lang.String = UastEmptyExpression] - UAnnotationMethod (name = getFoobarbaz) [public static final fun getFoobarbaz() : java.lang.String = UastEmptyExpression] + UMethod (name = getFoo) [public static final fun getFoo() : java.lang.String = UastEmptyExpression] + UMethod (name = getBar) [public static final fun getBar() : java.lang.String = UastEmptyExpression] + UMethod (name = getBaz) [public static final fun getBaz() : java.lang.String = UastEmptyExpression] + UMethod (name = getFoobarbaz) [public static final fun getFoobarbaz() : java.lang.String = UastEmptyExpression] diff --git a/plugins/uast-kotlin/testData/StringTemplateComplex.log.txt b/plugins/uast-kotlin/testData/StringTemplateComplex.log.txt index ff164143be8..57cb9a77c1e 100644 --- a/plugins/uast-kotlin/testData/StringTemplateComplex.log.txt +++ b/plugins/uast-kotlin/testData/StringTemplateComplex.log.txt @@ -38,19 +38,19 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = repeat, resolvesTo = null) ULiteralExpression (value = 4) ULiteralExpression (value = " z") - UAnnotationMethod (name = getMuchRecur) - UAnnotationMethod (name = getCase4) - UAnnotationMethod (name = getCase5) - UAnnotationMethod (name = getLiteralInLiteral) - UAnnotationMethod (name = getLiteralInLiteral2) - UAnnotationMethod (name = simpleForTemplate) + UMethod (name = getMuchRecur) + UMethod (name = getCase4) + UMethod (name = getCase5) + UMethod (name = getLiteralInLiteral) + UMethod (name = getLiteralInLiteral2) + UMethod (name = simpleForTemplate) UParameter (name = i) UAnnotation (fqName = org.jetbrains.annotations.NotNull) ULiteralExpression (value = 0) UBlockExpression UReturnExpression USimpleNameReferenceExpression (identifier = i) - UAnnotationMethod (name = foo) + UMethod (name = foo) UBlockExpression UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) UIdentifier (Identifier (println)) diff --git a/plugins/uast-kotlin/testData/StringTemplateComplex.types.txt b/plugins/uast-kotlin/testData/StringTemplateComplex.types.txt index 9cb8e02e338..646606ebb2e 100644 --- a/plugins/uast-kotlin/testData/StringTemplateComplex.types.txt +++ b/plugins/uast-kotlin/testData/StringTemplateComplex.types.txt @@ -38,19 +38,19 @@ UFile (package = ) [public final class StringTemplateComplexKt {...] USimpleNameReferenceExpression (identifier = repeat, resolvesTo = null) [repeat] : PsiType:String ULiteralExpression (value = 4) [4] : PsiType:int ULiteralExpression (value = " z") [" z"] : PsiType:String - UAnnotationMethod (name = getMuchRecur) [public static final fun getMuchRecur() : java.lang.String = UastEmptyExpression] - UAnnotationMethod (name = getCase4) [public static final fun getCase4() : java.lang.String = UastEmptyExpression] - UAnnotationMethod (name = getCase5) [public static final fun getCase5() : java.lang.String = UastEmptyExpression] - UAnnotationMethod (name = getLiteralInLiteral) [public static final fun getLiteralInLiteral() : java.lang.String = UastEmptyExpression] - UAnnotationMethod (name = getLiteralInLiteral2) [public static final fun getLiteralInLiteral2() : java.lang.String = UastEmptyExpression] - UAnnotationMethod (name = simpleForTemplate) [public static final fun simpleForTemplate(@org.jetbrains.annotations.NotNull i: int) : java.lang.String {...}] + UMethod (name = getMuchRecur) [public static final fun getMuchRecur() : java.lang.String = UastEmptyExpression] + UMethod (name = getCase4) [public static final fun getCase4() : java.lang.String = UastEmptyExpression] + UMethod (name = getCase5) [public static final fun getCase5() : java.lang.String = UastEmptyExpression] + UMethod (name = getLiteralInLiteral) [public static final fun getLiteralInLiteral() : java.lang.String = UastEmptyExpression] + UMethod (name = getLiteralInLiteral2) [public static final fun getLiteralInLiteral2() : java.lang.String = UastEmptyExpression] + UMethod (name = simpleForTemplate) [public static final fun simpleForTemplate(@org.jetbrains.annotations.NotNull i: int) : java.lang.String {...}] UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int = 0] UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] ULiteralExpression (value = 0) [0] : PsiType:int UBlockExpression [{...}] UReturnExpression [return i] USimpleNameReferenceExpression (identifier = i) [i] : PsiType:int - UAnnotationMethod (name = foo) [public static final fun foo() : void {...}] + UMethod (name = foo) [public static final fun foo() : void {...}] UBlockExpression [{...}] : PsiType:void UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(baz)] : PsiType:void UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] diff --git a/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.log.txt b/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.log.txt index 76958473117..055e30ab4ff 100644 --- a/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.log.txt +++ b/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.log.txt @@ -45,12 +45,12 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = repeat, resolvesTo = null) ULiteralExpression (value = 4) ULiteralExpression (value = " z") - UAnnotationMethod (name = getMuchRecur) - UAnnotationMethod (name = getCase4) - UAnnotationMethod (name = getCase5) - UAnnotationMethod (name = getLiteralInLiteral) - UAnnotationMethod (name = getLiteralInLiteral2) - UAnnotationMethod (name = simpleForTemplate) + UMethod (name = getMuchRecur) + UMethod (name = getCase4) + UMethod (name = getCase5) + UMethod (name = getLiteralInLiteral) + UMethod (name = getLiteralInLiteral2) + UMethod (name = simpleForTemplate) UParameter (name = i) UAnnotation (fqName = org.jetbrains.annotations.NotNull) ULiteralExpression (value = 0) @@ -58,7 +58,7 @@ UFile (package = ) UReturnExpression UPolyadicExpression (operator = +) USimpleNameReferenceExpression (identifier = i) - UAnnotationMethod (name = foo) + UMethod (name = foo) UBlockExpression UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) UIdentifier (Identifier (println)) diff --git a/plugins/uast-kotlin/testData/SuperCalls.identifiers.txt b/plugins/uast-kotlin/testData/SuperCalls.identifiers.txt index f7cea817651..475efe8c383 100644 --- a/plugins/uast-kotlin/testData/SuperCalls.identifiers.txt +++ b/plugins/uast-kotlin/testData/SuperCalls.identifiers.txt @@ -1,13 +1,13 @@ A -> UClass (name = A) str -> UParameter (name = str) String -> USimpleNameReferenceExpression (identifier = String) -constructor -> UAnnotationMethod (name = A) +constructor -> UMethod (name = A) i -> UParameter (name = i) Int -> USimpleNameReferenceExpression (identifier = Int) this -> UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) i -> USimpleNameReferenceExpression (identifier = i) toString -> UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) -foo -> UAnnotationMethod (name = foo) +foo -> UMethod (name = foo) a -> UParameter (name = a) Long -> USimpleNameReferenceExpression (identifier = Long) B -> UClass (name = B) @@ -17,18 +17,18 @@ A -> UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1 param -> USimpleNameReferenceExpression (identifier = param) C -> UClass (name = C) A -> USimpleNameReferenceExpression (identifier = A) -constructor -> UAnnotationMethod (name = C) +constructor -> UMethod (name = C) p -> UParameter (name = p) String -> USimpleNameReferenceExpression (identifier = String) super -> UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) p -> USimpleNameReferenceExpression (identifier = p) -constructor -> UAnnotationMethod (name = C) +constructor -> UMethod (name = C) i -> UParameter (name = i) Int -> USimpleNameReferenceExpression (identifier = Int) super -> UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) i -> USimpleNameReferenceExpression (identifier = i) println -> UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) -foo -> UAnnotationMethod (name = foo) +foo -> UMethod (name = foo) a -> UParameter (name = a) Long -> USimpleNameReferenceExpression (identifier = Long) super -> USimpleNameReferenceExpression (identifier = super) @@ -39,7 +39,7 @@ A -> UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1 anon -> UField (name = anon) object -> UClass (name = null) A -> UObjectLiteralExpression -bar -> UAnnotationMethod (name = bar) +bar -> UMethod (name = bar) cons -> UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) object -> UClass (name = null) A -> UObjectLiteralExpression @@ -47,6 +47,6 @@ innerObject -> UClass (name = innerObject) A -> UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) InnerClass -> UClass (name = InnerClass) A -> UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) -cons -> UAnnotationMethod (name = cons) +cons -> UMethod (name = cons) a -> UParameter (name = a) A -> USimpleNameReferenceExpression (identifier = A) diff --git a/plugins/uast-kotlin/testData/SuperCalls.log.txt b/plugins/uast-kotlin/testData/SuperCalls.log.txt index ad7cef2cc9c..4a9f10afe0c 100644 --- a/plugins/uast-kotlin/testData/SuperCalls.log.txt +++ b/plugins/uast-kotlin/testData/SuperCalls.log.txt @@ -5,7 +5,7 @@ UFile (package = ) UObjectLiteralExpression ULiteralExpression (value = "textForAnon") UClass (name = null) - UAnnotationMethod (name = bar) + UMethod (name = bar) UBlockExpression UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) UIdentifier (Identifier (cons)) @@ -13,41 +13,41 @@ UFile (package = ) UObjectLiteralExpression ULiteralExpression (value = "inner literal") UClass (name = null) - UAnnotationMethod (name = SuperCallsKt$anon$1$bar$1) - UAnnotationMethod (name = SuperCallsKt$anon$1) + UMethod (name = SuperCallsKt$anon$1$bar$1) + UMethod (name = SuperCallsKt$anon$1) UClass (name = innerObject) UField (name = INSTANCE) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = innerObject) + UMethod (name = innerObject) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (A)) USimpleNameReferenceExpression (identifier = , resolvesTo = A) ULiteralExpression (value = "inner object") UClass (name = InnerClass) - UAnnotationMethod (name = InnerClass) + UMethod (name = InnerClass) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (A)) USimpleNameReferenceExpression (identifier = , resolvesTo = A) ULiteralExpression (value = "inner class") - UAnnotationMethod (name = getAnon) - UAnnotationMethod (name = cons) + UMethod (name = getAnon) + UMethod (name = cons) UParameter (name = a) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression UClass (name = A) UField (name = str) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = foo) + UMethod (name = foo) UParameter (name = a) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression - UAnnotationMethod (name = getStr) - UAnnotationMethod (name = A) + UMethod (name = getStr) + UMethod (name = A) UParameter (name = str) UAnnotation (fqName = org.jetbrains.annotations.NotNull) - UAnnotationMethod (name = A) + UMethod (name = A) UParameter (name = i) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -60,7 +60,7 @@ UFile (package = ) UIdentifier (Identifier (toString)) USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) UClass (name = B) - UAnnotationMethod (name = B) + UMethod (name = B) UParameter (name = param) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -69,7 +69,7 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = , resolvesTo = A) USimpleNameReferenceExpression (identifier = param) UClass (name = C) - UAnnotationMethod (name = foo) + UMethod (name = foo) UParameter (name = a) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -79,7 +79,7 @@ UFile (package = ) UIdentifier (Identifier (foo)) USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) USimpleNameReferenceExpression (identifier = a) - UAnnotationMethod (name = C) + UMethod (name = C) UParameter (name = p) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -87,7 +87,7 @@ UFile (package = ) UIdentifier (Identifier (super)) USimpleNameReferenceExpression (identifier = , resolvesTo = A) USimpleNameReferenceExpression (identifier = p) - UAnnotationMethod (name = C) + UMethod (name = C) UParameter (name = i) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -101,7 +101,7 @@ UFile (package = ) UClass (name = O) UField (name = INSTANCE) UAnnotation (fqName = null) - UAnnotationMethod (name = O) + UMethod (name = O) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (A)) diff --git a/plugins/uast-kotlin/testData/TypeReferences.log.txt b/plugins/uast-kotlin/testData/TypeReferences.log.txt index 1cffd3a1b49..6173abf45b4 100644 --- a/plugins/uast-kotlin/testData/TypeReferences.log.txt +++ b/plugins/uast-kotlin/testData/TypeReferences.log.txt @@ -1,6 +1,6 @@ UFile (package = ) UClass (name = TypeReferencesKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UParameter (name = parameter) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -17,7 +17,7 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = varWithoutType) UReturnExpression USimpleNameReferenceExpression (identifier = result) - UAnnotationMethod (name = parameterizedFoo) + UMethod (name = parameterizedFoo) UParameter (name = arg) UAnnotation (fqName = org.jetbrains.annotations.Nullable) UBlockExpression diff --git a/plugins/uast-kotlin/testData/UnexpectedContainerException.log.txt b/plugins/uast-kotlin/testData/UnexpectedContainerException.log.txt index 68b70cbe286..d8b0fa29d03 100644 --- a/plugins/uast-kotlin/testData/UnexpectedContainerException.log.txt +++ b/plugins/uast-kotlin/testData/UnexpectedContainerException.log.txt @@ -1,10 +1,10 @@ UFile (package = ) UClass (name = Callback) - UAnnotationMethod (name = onError) + UMethod (name = onError) UParameter (name = throwable) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UClass (name = Model) - UAnnotationMethod (name = crashMe) + UMethod (name = crashMe) UParameter (name = clazz) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UParameter (name = factory) @@ -14,7 +14,7 @@ UFile (package = ) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (UnsupportedOperationException)) USimpleNameReferenceExpression (identifier = , resolvesTo = UnsupportedOperationException) - UAnnotationMethod (name = Model) + UMethod (name = Model) UBlockExpression UBlockExpression UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) @@ -28,7 +28,7 @@ UFile (package = ) UReturnExpression UObjectLiteralExpression UClass (name = null) - UAnnotationMethod (name = onError) + UMethod (name = onError) UParameter (name = throwable) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression @@ -37,4 +37,4 @@ UFile (package = ) UIdentifier (Identifier (UnsupportedOperationException)) USimpleNameReferenceExpression (identifier = , resolvesTo = UnsupportedOperationException) ULiteralExpression (value = "") - UAnnotationMethod (name = Model$1$1) + UMethod (name = Model$1$1) diff --git a/plugins/uast-kotlin/testData/UnexpectedContainerException.types.txt b/plugins/uast-kotlin/testData/UnexpectedContainerException.types.txt index 88a701c1009..9b22766399f 100644 --- a/plugins/uast-kotlin/testData/UnexpectedContainerException.types.txt +++ b/plugins/uast-kotlin/testData/UnexpectedContainerException.types.txt @@ -1,10 +1,10 @@ UFile (package = ) [public abstract interface Callback {...] UClass (name = Callback) [public abstract interface Callback {...}] - UAnnotationMethod (name = onError) [public abstract fun onError(@org.jetbrains.annotations.NotNull throwable: java.lang.Throwable) : void = UastEmptyExpression] + UMethod (name = onError) [public abstract fun onError(@org.jetbrains.annotations.NotNull throwable: java.lang.Throwable) : void = UastEmptyExpression] UParameter (name = throwable) [@org.jetbrains.annotations.NotNull var throwable: java.lang.Throwable] UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] UClass (name = Model) [public final class Model {...}] - UAnnotationMethod (name = crashMe) [public final fun crashMe(@org.jetbrains.annotations.NotNull clazz: java.lang.Class, @org.jetbrains.annotations.NotNull factory: kotlin.jvm.functions.Function0) : void {...}] + UMethod (name = crashMe) [public final fun crashMe(@org.jetbrains.annotations.NotNull clazz: java.lang.Class, @org.jetbrains.annotations.NotNull factory: kotlin.jvm.functions.Function0) : void {...}] UParameter (name = clazz) [@org.jetbrains.annotations.NotNull var clazz: java.lang.Class] UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] UParameter (name = factory) [@org.jetbrains.annotations.NotNull var factory: kotlin.jvm.functions.Function0] @@ -14,7 +14,7 @@ UFile (package = ) [public abstract interface Callback {...] UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType:UnsupportedOperationException UIdentifier (Identifier (UnsupportedOperationException)) [UIdentifier (Identifier (UnsupportedOperationException))] USimpleNameReferenceExpression (identifier = , resolvesTo = UnsupportedOperationException) [] : PsiType:UnsupportedOperationException - UAnnotationMethod (name = Model) [public fun Model() {...}] + UMethod (name = Model) [public fun Model() {...}] UBlockExpression [{...}] UBlockExpression [{...}] : PsiType:void UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [crashMe(Callback.java, { ...})] : PsiType:void @@ -28,7 +28,7 @@ UFile (package = ) [public abstract interface Callback {...] UReturnExpression [return anonymous object : Callback {... }] UObjectLiteralExpression [anonymous object : Callback {... }] : PsiType:Callback UClass (name = null) [final class null : Callback {...}] - UAnnotationMethod (name = onError) [public fun onError(@org.jetbrains.annotations.NotNull throwable: java.lang.Throwable) : void {...}] + UMethod (name = onError) [public fun onError(@org.jetbrains.annotations.NotNull throwable: java.lang.Throwable) : void {...}] UParameter (name = throwable) [@org.jetbrains.annotations.NotNull var throwable: java.lang.Throwable] UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] UBlockExpression [{...}] : PsiType:Void @@ -37,4 +37,4 @@ UFile (package = ) [public abstract interface Callback {...] UIdentifier (Identifier (UnsupportedOperationException)) [UIdentifier (Identifier (UnsupportedOperationException))] USimpleNameReferenceExpression (identifier = , resolvesTo = UnsupportedOperationException) [] : PsiType:UnsupportedOperationException ULiteralExpression (value = "") [""] : PsiType:String - UAnnotationMethod (name = Model$1$1) [fun Model$1$1() = UastEmptyExpression] + UMethod (name = Model$1$1) [fun Model$1$1() = UastEmptyExpression] diff --git a/plugins/uast-kotlin/testData/WhenAndDestructing.log.txt b/plugins/uast-kotlin/testData/WhenAndDestructing.log.txt index 1d1c4d186c8..cd9124b0aab 100644 --- a/plugins/uast-kotlin/testData/WhenAndDestructing.log.txt +++ b/plugins/uast-kotlin/testData/WhenAndDestructing.log.txt @@ -1,6 +1,6 @@ UFile (package = ) UClass (name = WhenAndDestructingKt) - UAnnotationMethod (name = getElementsAdditionalResolve) + UMethod (name = getElementsAdditionalResolve) UParameter (name = string) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression diff --git a/plugins/uast-kotlin/testData/WhenIs.log.txt b/plugins/uast-kotlin/testData/WhenIs.log.txt index 2428a6297de..0941dd1c738 100644 --- a/plugins/uast-kotlin/testData/WhenIs.log.txt +++ b/plugins/uast-kotlin/testData/WhenIs.log.txt @@ -1,6 +1,6 @@ UFile (package = ) UClass (name = WhenIsKt) - UAnnotationMethod (name = foo) + UMethod (name = foo) UParameter (name = bar) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UBlockExpression diff --git a/plugins/uast-kotlin/testData/WhenStringLiteral.log.txt b/plugins/uast-kotlin/testData/WhenStringLiteral.log.txt index 001ebb0f2e2..e689d23089e 100644 --- a/plugins/uast-kotlin/testData/WhenStringLiteral.log.txt +++ b/plugins/uast-kotlin/testData/WhenStringLiteral.log.txt @@ -25,9 +25,9 @@ UFile (package = ) UExpressionList (when_entry) ULiteralExpression (value = 3) UBreakExpression (label = null) - UAnnotationMethod (name = getA) - UAnnotationMethod (name = getB) - UAnnotationMethod (name = ) + UMethod (name = getA) + UMethod (name = getB) + UMethod (name = ) UBlockExpression ULiteralExpression (value = "abc1") ULiteralExpression (value = "def1") diff --git a/plugins/uast-kotlin/testData/ea101715.types.txt b/plugins/uast-kotlin/testData/ea101715.types.txt index 161061eebf3..4835b1316b3 100644 --- a/plugins/uast-kotlin/testData/ea101715.types.txt +++ b/plugins/uast-kotlin/testData/ea101715.types.txt @@ -1,6 +1,6 @@ UFile (package = ) [public final class Ea101715Kt {...] UClass (name = Ea101715Kt) [public final class Ea101715Kt {...}] - UAnnotationMethod (name = a) [public static final fun a() : void {...}] + UMethod (name = a) [public static final fun a() : void {...}] UBlockExpression [{...}] : PsiType:void UDeclarationsExpression [var a: = Obj(555)] ULocalVariable (name = a) [var a: = Obj(555)] @@ -11,4 +11,4 @@ UFile (package = ) [public final class Ea101715Kt {...] UClass (name = Obj) [public final class Obj {...}] UField (name = INSTANCE) [@null public static final var INSTANCE: Obj] UAnnotation (fqName = null) [@null] - UAnnotationMethod (name = Obj) [private fun Obj() = UastEmptyExpression] + UMethod (name = Obj) [private fun Obj() = UastEmptyExpression]