Support getContainer for the synthetic it value parameter
Also fixed incorrect KtSymbolOrigin: it was SOURCE instead of SOURCE_MEMBER_GENERATED
This commit is contained in:
@@ -53,6 +53,7 @@ enum class KtSymbolOrigin {
|
||||
* Declaration which do not have it's PSI source and was generated, they are:
|
||||
* For data classes the `copy`, `component{N}`, `toString`, `equals`, `hashCode` functions are generated
|
||||
* For enum classes the `valueOf` & `values` functions are generated
|
||||
* For lambda the `it` property is generated
|
||||
*/
|
||||
SOURCE_MEMBER_GENERATED,
|
||||
|
||||
|
||||
+1
-1
@@ -139,7 +139,7 @@ object FirIdeDeserializedDeclarationSourceProvider {
|
||||
|
||||
private fun KtElement.isCompiled(): Boolean = containingKtFile.isCompiled
|
||||
|
||||
private val allowedFakeElementKinds = setOf(FirFakeSourceElementKind.PropertyFromParameter)
|
||||
private val allowedFakeElementKinds = setOf(FirFakeSourceElementKind.PropertyFromParameter, FirFakeSourceElementKind.ItLambdaParameter)
|
||||
|
||||
private fun FirElement.getAllowedPsi() = when (val source = source) {
|
||||
null -> null
|
||||
|
||||
+1
@@ -26,6 +26,7 @@ private tailrec fun FirDeclaration.ktSymbolOrigin(): KtSymbolOrigin = when (orig
|
||||
FirDeclarationOrigin.Source -> {
|
||||
if (source?.kind == FirFakeSourceElementKind.DataClassGeneratedMembers
|
||||
|| source?.kind == FirFakeSourceElementKind.EnumGeneratedDeclaration
|
||||
|| source?.kind == FirFakeSourceElementKind.ItLambdaParameter
|
||||
) {
|
||||
KtSymbolOrigin.SOURCE_MEMBER_GENERATED
|
||||
} else KtSymbolOrigin.SOURCE
|
||||
|
||||
Reference in New Issue
Block a user