Commit 1952b41f authored by Jinseong Jeon's avatar Jinseong Jeon
Browse files

FIR/UAST: resolve implicit lambda parameter

^KTIJ-18800 Fixed
parent 69b88c81
Showing with 107 additions and 19 deletions
+107 -19
......@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCaseBase
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCaseBase.assertContainsElements
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCaseBase.assertDoesntContain
import org.jetbrains.kotlin.psi.KtConstructor
import org.jetbrains.kotlin.psi.KtParameter
import org.jetbrains.kotlin.utils.addToStdlib.cast
import org.jetbrains.uast.*
import org.jetbrains.uast.kotlin.KotlinUFunctionCallExpression
......@@ -380,6 +381,52 @@ interface UastResolveApiFixtureTestBase : UastPluginSelection {
TestCase.assertEquals("message", resolved.name)
}
fun checkResolveExplicitLambdaParameter(myFixture: JavaCodeInsightTestFixture) {
myFixture.configureByText(
"main.kt", """
inline fun <T, R> T.use(block: (T) -> R): R {
return block(this)
}
fun foo() {
42.use { it ->
i<caret>t.toString()
}
}
""".trimIndent()
)
val uCallExpression = myFixture.file.findElementAt(myFixture.caretOffset).toUElement().getUCallExpression()
.orFail("cant convert to UCallExpression")
TestCase.assertEquals("it", (uCallExpression.receiver as? USimpleNameReferenceExpression)?.identifier)
// Expect to be resolved to source KtParameter
val resolved = (uCallExpression.receiver?.tryResolve() as? KtParameter)
.orFail("cant resolve explicit lambda parameter")
TestCase.assertEquals("it", resolved.name)
}
fun checkResolveImplicitLambdaParameter(myFixture: JavaCodeInsightTestFixture) {
myFixture.configureByText(
"main.kt", """
inline fun <T, R> T.use(block: (T) -> R): R {
return block(this)
}
fun foo() {
42.use { i<caret>t.toString() }
}
""".trimIndent()
)
val uCallExpression = myFixture.file.findElementAt(myFixture.caretOffset).toUElement().getUCallExpression()
.orFail("cant convert to UCallExpression")
TestCase.assertEquals("it", (uCallExpression.receiver as? USimpleNameReferenceExpression)?.identifier)
// No source for implicit lambda parameter. Expect to be resolved to fake PsiParameter used inside ULambdaExpression
val resolved = (uCallExpression.receiver?.tryResolve() as? PsiParameter)
.orFail("cant resolve implicit lambda parameter")
TestCase.assertEquals("it", resolved.name)
}
fun checkResolveSyntheticMethod(myFixture: JavaCodeInsightTestFixture) {
myFixture.configureByText(
"MyClass.kt", """
......
......@@ -358,6 +358,15 @@ interface FirKotlinUastResolveProviderService : BaseKotlinUastResolveProviderSer
)?.let { return it }
}
}
is KtFunctionLiteral -> {
// Implicit lambda parameter `it`
if ((resolvedTargetSymbol as? KtValueParameterSymbol)?.isImplicitLambdaParameter == true) {
// From its containing lambda (of function literal), build ULambdaExpression
val lambda = resolvedTargetElement.toUElementOfType<ULambdaExpression>()
// and return javaPsi of the corresponding lambda implicit parameter
lambda?.valueParameters?.singleOrNull()?.javaPsi?.let { return it }
}
}
}
// TODO: need to handle resolved target to library source
......
......@@ -117,6 +117,14 @@ class FirUastResolveApiFixtureTest : KotlinLightCodeInsightFixtureTestCase(), Ua
doCheck("ResolveCompiledAnnotation", ::checkResolveCompiledAnnotation)
}
fun testResolveExplicitLambdaParameter() {
doCheck("ResolveExplicitLambdaParameter", ::checkResolveExplicitLambdaParameter)
}
fun testResolveImplicitLambdaParameter() {
doCheck("ResolveImplicitLambdaParameter", ::checkResolveImplicitLambdaParameter)
}
fun testResolveSyntheticMethod() {
doCheck("ResolveSyntheticMethod", ::checkResolveSyntheticMethod)
}
......
......@@ -10,5 +10,5 @@ UBlockExpression -> UQualifiedReferenceExpression -> Decompiled_Method: map
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = of) -> Decompiled_Method: of
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = map) -> Decompiled_Method: map
UReturnExpression -> UQualifiedReferenceExpression -> Decompiled_Method: toString
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> null: null
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))(resolves to null) -> USimpleNameReferenceExpression (identifier = toString) -> Decompiled_Method: toString
......@@ -10,5 +10,5 @@ UBlockExpression -> UQualifiedReferenceExpression -> Decompiled_Method: map
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = of) -> Decompiled_Method: of
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = map) -> Decompiled_Method: map
UReturnExpression -> UQualifiedReferenceExpression -> null: null
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> FUNCTION_LITERAL: <anonymous>
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))(resolves to null) -> USimpleNameReferenceExpression (identifier = toString) -> FUN: toString
......@@ -2,4 +2,4 @@ UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolve
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = append) -> Decompiled_Method: append
UBlockExpression -> UQualifiedReferenceExpression -> Decompiled_Method: let
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = let) -> Decompiled_Method: let
UReturnExpression -> USimpleNameReferenceExpression (identifier = it) -> null: null
UReturnExpression -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
......@@ -2,4 +2,4 @@ UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolve
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = append) -> Decompiled_Method: append
UBlockExpression -> UQualifiedReferenceExpression -> null: null
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to null) -> USimpleNameReferenceExpression (identifier = let) -> FUN: let
UReturnExpression -> USimpleNameReferenceExpression (identifier = it) -> FUNCTION_LITERAL: <anonymous>
UReturnExpression -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
......@@ -34,9 +34,9 @@ UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = ko
UBinaryExpression (operator = +) -> USimpleNameReferenceExpression (identifier = +) -> Kotlin_Light_Method: plus
UBinaryExpression (operator = +) -> USimpleNameReferenceExpression (identifier = a) -> VALUE_PARAMETER: a
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Kotlin_Light_Method) -> USimpleNameReferenceExpression (identifier = bar) -> Kotlin_Light_Method: bar
UBinaryExpression (operator = >) -> USimpleNameReferenceExpression (identifier = it) -> null: null
UBinaryExpression (operator = >) -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
UBinaryExpression (operator = >) -> USimpleNameReferenceExpression (identifier = >) -> null: null
UBinaryExpression (operator = +) -> USimpleNameReferenceExpression (identifier = it) -> null: null
UBinaryExpression (operator = +) -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
UBinaryExpression (operator = +) -> USimpleNameReferenceExpression (identifier = +) -> null: null
UBinaryExpression (operator = +) -> USimpleNameReferenceExpression (identifier = b) -> Kotlin_Light_Variable: b
UTypeReferenceExpression (name = kotlin.Unit) -> USimpleNameReferenceExpression (identifier = Unit) -> Decompiled_Class: Unit
......
......@@ -34,9 +34,9 @@ UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = ko
UBinaryExpression (operator = +) -> USimpleNameReferenceExpression (identifier = +) -> FUN: plus
UBinaryExpression (operator = +) -> USimpleNameReferenceExpression (identifier = a) -> VALUE_PARAMETER: a
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Kotlin_Light_Method) -> USimpleNameReferenceExpression (identifier = bar) -> Kotlin_Light_Method: bar
UBinaryExpression (operator = >) -> USimpleNameReferenceExpression (identifier = it) -> FUNCTION_LITERAL: <anonymous>
UBinaryExpression (operator = >) -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
UBinaryExpression (operator = >) -> USimpleNameReferenceExpression (identifier = >) -> FUN: compareTo
UBinaryExpression (operator = +) -> USimpleNameReferenceExpression (identifier = it) -> FUNCTION_LITERAL: <anonymous>
UBinaryExpression (operator = +) -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
UBinaryExpression (operator = +) -> USimpleNameReferenceExpression (identifier = +) -> FUN: plus
UBinaryExpression (operator = +) -> USimpleNameReferenceExpression (identifier = b) -> Kotlin_Light_Variable: b
UTypeReferenceExpression (name = kotlin.Unit) -> USimpleNameReferenceExpression (identifier = Unit) -> Decompiled_Class: Unit
......
......@@ -12,7 +12,7 @@ UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = St
UTypeReferenceExpression (name = java.lang.String) -> USimpleNameReferenceExpression (identifier = String) -> Decompiled_Class: String
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = filter) -> Decompiled_Method: filter
UReturnExpression -> UQualifiedReferenceExpression -> Decompiled_Method: isEmpty
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> null: null
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = isEmpty) -> Decompiled_Method: isEmpty
UTypeReferenceExpression (name = kotlin.Unit) -> USimpleNameReferenceExpression (identifier = Unit) -> Decompiled_Class: Unit
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))(resolves to null) -> USimpleNameReferenceExpression (identifier = selectItemFunction) -> Kotlin_Light_Value_Parameter: selectItemFunction
......
......@@ -12,7 +12,7 @@ UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = St
UTypeReferenceExpression (name = java.lang.String) -> USimpleNameReferenceExpression (identifier = String) -> null: null
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = filter) -> Decompiled_Method: filter
UReturnExpression -> UQualifiedReferenceExpression -> null: null
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> FUNCTION_LITERAL: <anonymous>
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))(resolves to null) -> USimpleNameReferenceExpression (identifier = isEmpty) -> FUN: isEmpty
UTypeReferenceExpression (name = kotlin.Unit) -> USimpleNameReferenceExpression (identifier = Unit) -> Decompiled_Class: Unit
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = selectItemFunction) -> Kotlin_Light_Value_Parameter: selectItemFunction
......
......@@ -24,7 +24,7 @@ UBlockExpression -> UQualifiedReferenceExpression -> Kotlin_Light_Method: foo
}: A
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = forEach) -> Decompiled_Method: forEach
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = println) -> Decompiled_Method: println
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = it) -> null: null
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
UBlockExpression -> UQualifiedReferenceExpression -> Decompiled_Method: joinToString
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = listOf) -> Decompiled_Method: listOf
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = joinToString) -> Decompiled_Method: joinToString
......
......@@ -24,7 +24,7 @@ UBlockExpression -> UQualifiedReferenceExpression -> Kotlin_Light_Method: foo
}: A
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to null) -> USimpleNameReferenceExpression (identifier = forEach) -> FUN: forEach
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = println) -> Decompiled_Method: println
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = it) -> FUNCTION_LITERAL: <anonymous>
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
UBlockExpression -> UQualifiedReferenceExpression -> null: null
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to null) -> USimpleNameReferenceExpression (identifier = listOf) -> FUN: listOf
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))(resolves to null) -> USimpleNameReferenceExpression (identifier = joinToString) -> FUN: joinToString
......
......@@ -23,7 +23,7 @@ UTypeReferenceExpression (name = T) -> USimpleNameReferenceExpression (identifie
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = tl) -> Kotlin_Light_Variable: tl
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to Decompiled_Method) -> USimpleNameReferenceExpression (identifier = map) -> Decompiled_Method: map
UReturnExpression -> UQualifiedReferenceExpression -> null: null
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> null: null
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))(resolves to null) -> USimpleNameReferenceExpression (identifier = toString) -> null: null
UTypeReferenceExpression (name = java.util.List<? extends java.util.List<? extends java.lang.String>>) -> USimpleNameReferenceExpression (identifier = List) -> Decompiled_Class: List
UTypeReferenceExpression (name = java.util.List<? extends java.lang.String>) -> USimpleNameReferenceExpression (identifier = List) -> Decompiled_Class: List
......
......@@ -23,7 +23,7 @@ UTypeReferenceExpression (name = T) -> USimpleNameReferenceExpression (identifie
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = tl) -> Kotlin_Light_Variable: tl
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to null) -> USimpleNameReferenceExpression (identifier = map) -> FUN: map
UReturnExpression -> UQualifiedReferenceExpression -> null: null
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> FUNCTION_LITERAL: <anonymous>
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> Kotlin_Light_Value_Parameter: it
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))(resolves to null) -> USimpleNameReferenceExpression (identifier = toString) -> FUN: toString
UTypeReferenceExpression (name = java.util.List<? extends java.util.List<? extends java.lang.String>>) -> USimpleNameReferenceExpression (identifier = List) -> Decompiled_Class: List
UTypeReferenceExpression (name = java.util.List<? extends java.lang.String>) -> USimpleNameReferenceExpression (identifier = List) -> Decompiled_Class: List
......
......@@ -14,16 +14,17 @@ import com.intellij.psi.impl.compiled.StubBuildingVisitor
import com.intellij.psi.util.PsiTypesUtil
import com.intellij.util.SmartList
import org.jetbrains.kotlin.asJava.*
import org.jetbrains.kotlin.backend.jvm.serialization.DisabledDescriptorMangler.signatureString
import org.jetbrains.kotlin.builtins.isBuiltinFunctionalTypeOrSubtype
import org.jetbrains.kotlin.codegen.signature.BothSignatureWriter
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.AnnotationArgumentVisitor
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.descriptors.impl.AnonymousFunctionDescriptor
import org.jetbrains.kotlin.descriptors.impl.EnumEntrySyntheticClassDescriptor
import org.jetbrains.kotlin.descriptors.impl.TypeAliasConstructorDescriptor
import org.jetbrains.kotlin.descriptors.synthetic.SyntheticMemberDescriptor
import org.jetbrains.kotlin.idea.KotlinLanguage
import org.jetbrains.kotlin.js.resolve.diagnostics.findPsi
import org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageFragment
import org.jetbrains.kotlin.load.java.sam.SamAdapterDescriptor
import org.jetbrains.kotlin.load.kotlin.KotlinJvmBinaryPackageSourceElement
......@@ -45,7 +46,6 @@ import org.jetbrains.kotlin.resolve.calls.inference.model.TypeVariableTypeConstr
import org.jetbrains.kotlin.resolve.calls.model.ArgumentMatch
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
import org.jetbrains.kotlin.resolve.calls.tower.NewResolvedCallImpl
import org.jetbrains.kotlin.resolve.calls.util.isFakePsiElement
import org.jetbrains.kotlin.resolve.constants.*
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.resolve.references.ReferenceAccess
......@@ -384,6 +384,13 @@ fun resolveToDeclarationImpl(sourcePsi: KtExpression, declarationDescriptor: Dec
if (parentDeclaration is PsiClass && parentDeclaration.isAnnotationType) {
parentDeclaration.findMethodsByName(declarationDescriptor.name.asString(), false).firstOrNull()?.let { return it }
}
// Implicit lambda parameter `it`
if (declarationDescriptor.isImplicitLambdaParameter(sourcePsi)) {
// From its containing lambda (of function literal), build ULambdaExpression
val lambda = declarationDescriptor.containingDeclaration.findPsi().toUElementOfType<ULambdaExpression>()
// and return javaPsi of the corresponding lambda implicit parameter
return lambda?.valueParameters?.singleOrNull()?.javaPsi
}
}
if (declarationDescriptor is CallableMemberDescriptor && declarationDescriptor.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE) {
......@@ -398,6 +405,15 @@ fun resolveToDeclarationImpl(sourcePsi: KtExpression, declarationDescriptor: Dec
return null
}
private fun ValueParameterDescriptor.isImplicitLambdaParameter(sourcePsi: KtExpression): Boolean {
return containingDeclaration is AnonymousFunctionDescriptor &&
name.identifierOrNullIfSpecial == "it" &&
// Implicit lambda parameter doesn't have a source PSI.
source.getPsi() == null &&
// But, that could be the case for a declaration from Library. Double-check the slice in the binding context
sourcePsi.analyze().get(BindingContext.AUTO_CREATED_IT, this) != null
}
private fun resolveContainingDeserializedClass(context: KtElement, memberDescriptor: DeserializedCallableMemberDescriptor): PsiClass? {
return when (val containingDeclaration = memberDescriptor.containingDeclaration) {
is LazyJavaPackageFragment -> {
......
......@@ -63,6 +63,14 @@ class FE1UastResolveApiFixtureTest : KotlinLightCodeInsightFixtureTestCase(), Ua
checkResolveCompiledAnnotation(myFixture)
}
fun testResolveExplicitLambdaParameter() {
checkResolveExplicitLambdaParameter(myFixture)
}
fun testResolveImplicitLambdaParameter() {
checkResolveImplicitLambdaParameter(myFixture)
}
fun testResolveSyntheticMethod() {
checkResolveSyntheticMethod(myFixture)
}
......@@ -82,4 +90,4 @@ class FE1UastResolveApiFixtureTest : KotlinLightCodeInsightFixtureTestCase(), Ua
fun testSyntheticEnumMethods() {
checkSyntheticEnumMethods(myFixture)
}
}
\ No newline at end of file
}
......@@ -24,7 +24,7 @@ UBlockExpression -> UQualifiedReferenceExpression -> KtUltraLightMethodForSource
}: A
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to PsiMethod:forEach) -> USimpleNameReferenceExpression (identifier = forEach) -> PsiMethod:forEach: forEach
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to PsiMethod:println) -> USimpleNameReferenceExpression (identifier = println) -> PsiMethod:println: println
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to PsiMethod:println) -> USimpleNameReferenceExpression (identifier = it) -> null: null
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to PsiMethod:println) -> USimpleNameReferenceExpression (identifier = it) -> Light Parameter: it
UBlockExpression -> UQualifiedReferenceExpression -> PsiMethod:joinToString: joinToString
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to PsiMethod:listOf) -> USimpleNameReferenceExpression (identifier = listOf) -> PsiMethod:listOf: listOf
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))(resolves to PsiMethod:joinToString) -> USimpleNameReferenceExpression (identifier = joinToString) -> PsiMethod:joinToString: joinToString
......
......@@ -23,7 +23,7 @@ UTypeReferenceExpression (name = T) -> USimpleNameReferenceExpression (identifie
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = tl) -> LightVariableBuilder:tl: tl
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))(resolves to PsiMethod:map) -> USimpleNameReferenceExpression (identifier = map) -> PsiMethod:map: map
UReturnExpression -> UQualifiedReferenceExpression -> null: null
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> null: null
UQualifiedReferenceExpression -> USimpleNameReferenceExpression (identifier = it) -> Light Parameter: it
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))(resolves to null) -> USimpleNameReferenceExpression (identifier = toString) -> null: null
UTypeReferenceExpression (name = java.util.List<? extends java.util.List<? extends java.lang.String>>) -> USimpleNameReferenceExpression (identifier = List) -> PsiClass:List: List
UTypeReferenceExpression (name = java.util.List<? extends java.lang.String>) -> USimpleNameReferenceExpression (identifier = List) -> PsiClass:List: List
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment