@@ -235,41 +235,42 @@ internal fun ModuleClassResolver.resolveContainingClass(psiMethod: PsiMethod): C
235
235
}
236
236
237
237
internal fun getInstanceForCurrentRound (node : KSNode ): KSNode ? {
238
- when (node.origin) {
239
- Origin .KOTLIN_LIB , Origin .JAVA_LIB -> return null
240
- }
241
- return when (node) {
242
- is KSClassDeclarationImpl -> KSClassDeclarationImpl .getCached(node.ktClassOrObject)
243
- is KSFileImpl -> KSFileImpl .getCached(node.file)
244
- is KSFunctionDeclarationImpl -> KSFunctionDeclarationImpl .getCached(node.ktFunction)
245
- is KSPropertyDeclarationImpl -> KSPropertyDeclarationImpl .getCached(node.ktProperty)
246
- is KSPropertyGetterImpl -> KSPropertyGetterImpl .getCached(node.ktPropertyAccessor)
247
- is KSPropertySetterImpl -> KSPropertySetterImpl .getCached(node.ktPropertyAccessor)
248
- is KSTypeAliasImpl -> KSTypeAliasImpl .getCached(node.ktTypeAlias)
249
- is KSTypeArgumentLiteImpl -> KSTypeArgumentLiteImpl .getCached(node.type, node.variance)
250
- is KSTypeArgumentKtImpl -> KSTypeArgumentKtImpl .getCached(node.ktTypeArgument)
251
- is KSTypeParameterImpl -> KSTypeParameterImpl .getCached(node.ktTypeParameter)
252
- is KSTypeReferenceImpl -> KSTypeReferenceImpl .getCached(node.ktTypeReference)
253
- is KSValueParameterImpl -> KSValueParameterImpl .getCached(node.ktParameter)
254
- is KSClassDeclarationJavaEnumEntryImpl -> KSClassDeclarationJavaEnumEntryImpl .getCached(node.psi)
255
- is KSClassDeclarationJavaImpl -> KSClassDeclarationJavaImpl .getCached(node.psi)
256
- is KSFileJavaImpl -> KSFileJavaImpl .getCached(node.psi)
257
- is KSFunctionDeclarationJavaImpl -> KSFunctionDeclarationJavaImpl .getCached(node.psi)
258
- is KSPropertyDeclarationJavaImpl -> KSPropertyDeclarationJavaImpl .getCached(node.psi)
259
- is KSTypeArgumentJavaImpl -> KSTypeArgumentJavaImpl .getCached(node.psi, node.parent)
260
- is KSTypeParameterJavaImpl -> KSTypeParameterJavaImpl .getCached(node.psi)
261
- is KSTypeReferenceJavaImpl ->
262
- KSTypeReferenceJavaImpl .getCached(node.psi, (node.parent as ? KSAnnotated )?.getInstanceForCurrentRound())
263
- is KSValueParameterJavaImpl -> KSValueParameterJavaImpl .getCached(node.psi)
264
- is KSPropertyGetterSyntheticImpl -> KSPropertyGetterSyntheticImpl .getCached(node.ksPropertyDeclaration)
265
- is KSPropertySetterSyntheticImpl -> KSPropertySetterSyntheticImpl .getCached(node.ksPropertyDeclaration)
266
- is KSValueParameterSyntheticImpl -> KSPropertySetterImpl .getCached(node.owner as KtPropertyAccessor ).parameter
267
- is KSAnnotationJavaImpl -> KSAnnotationJavaImpl .getCached(node.psi)
268
- is KSAnnotationImpl -> KSAnnotationImpl .getCached(node.ktAnnotationEntry)
269
- is KSClassifierReferenceJavaImpl -> KSClassifierReferenceJavaImpl .getCached(node.psi, node.parent)
270
- is KSValueArgumentJavaImpl ->
271
- KSValueArgumentJavaImpl .getCached(node.name, node.value, getInstanceForCurrentRound(node.parent!! ))
272
- else -> null
238
+ return when (node.origin) {
239
+ Origin .KOTLIN_LIB , Origin .JAVA_LIB -> null
240
+ else -> when (node) {
241
+ is KSClassDeclarationImpl -> KSClassDeclarationImpl .getCached(node.ktClassOrObject)
242
+ is KSFileImpl -> KSFileImpl .getCached(node.file)
243
+ is KSFunctionDeclarationImpl -> KSFunctionDeclarationImpl .getCached(node.ktFunction)
244
+ is KSPropertyDeclarationImpl -> KSPropertyDeclarationImpl .getCached(node.ktProperty)
245
+ is KSPropertyGetterImpl -> KSPropertyGetterImpl .getCached(node.ktPropertyAccessor)
246
+ is KSPropertySetterImpl -> KSPropertySetterImpl .getCached(node.ktPropertyAccessor)
247
+ is KSTypeAliasImpl -> KSTypeAliasImpl .getCached(node.ktTypeAlias)
248
+ is KSTypeArgumentLiteImpl -> KSTypeArgumentLiteImpl .getCached(node.type, node.variance)
249
+ is KSTypeArgumentKtImpl -> KSTypeArgumentKtImpl .getCached(node.ktTypeArgument)
250
+ is KSTypeParameterImpl -> KSTypeParameterImpl .getCached(node.ktTypeParameter)
251
+ is KSTypeReferenceImpl -> KSTypeReferenceImpl .getCached(node.ktTypeReference)
252
+ is KSValueParameterImpl -> KSValueParameterImpl .getCached(node.ktParameter)
253
+ is KSClassDeclarationJavaEnumEntryImpl -> KSClassDeclarationJavaEnumEntryImpl .getCached(node.psi)
254
+ is KSClassDeclarationJavaImpl -> KSClassDeclarationJavaImpl .getCached(node.psi)
255
+ is KSFileJavaImpl -> KSFileJavaImpl .getCached(node.psi)
256
+ is KSFunctionDeclarationJavaImpl -> KSFunctionDeclarationJavaImpl .getCached(node.psi)
257
+ is KSPropertyDeclarationJavaImpl -> KSPropertyDeclarationJavaImpl .getCached(node.psi)
258
+ is KSTypeArgumentJavaImpl -> KSTypeArgumentJavaImpl .getCached(node.psi, node.parent)
259
+ is KSTypeParameterJavaImpl -> KSTypeParameterJavaImpl .getCached(node.psi)
260
+ is KSTypeReferenceJavaImpl ->
261
+ KSTypeReferenceJavaImpl .getCached(node.psi, (node.parent as ? KSAnnotated )?.getInstanceForCurrentRound())
262
+ is KSValueParameterJavaImpl -> KSValueParameterJavaImpl .getCached(node.psi)
263
+ is KSPropertyGetterSyntheticImpl -> KSPropertyGetterSyntheticImpl .getCached(node.ksPropertyDeclaration)
264
+ is KSPropertySetterSyntheticImpl -> KSPropertySetterSyntheticImpl .getCached(node.ksPropertyDeclaration)
265
+ is KSValueParameterSyntheticImpl ->
266
+ KSPropertySetterImpl .getCached(node.owner as KtPropertyAccessor ).parameter
267
+ is KSAnnotationJavaImpl -> KSAnnotationJavaImpl .getCached(node.psi)
268
+ is KSAnnotationImpl -> KSAnnotationImpl .getCached(node.ktAnnotationEntry)
269
+ is KSClassifierReferenceJavaImpl -> KSClassifierReferenceJavaImpl .getCached(node.psi, node.parent)
270
+ is KSValueArgumentJavaImpl ->
271
+ KSValueArgumentJavaImpl .getCached(node.name, node.value, getInstanceForCurrentRound(node.parent!! ))
272
+ else -> null
273
+ }
273
274
}
274
275
}
275
276
0 commit comments