@ -32,6 +32,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
internal const val DESKTOP _PREVIEW _ANNOTATION _FQN = " androidx.compose.desktop.ui.tooling.preview.Preview "
internal const val DESKTOP _PREVIEW _ANNOTATION _FQN = " androidx.compose.desktop.ui.tooling.preview.Preview "
internal const val COMMON _PREVIEW _ANNOTATION _FQN = " org.jetbrains.compose.ui.tooling.preview.Preview "
internal const val COMPOSABLE _FQ _NAME = " androidx.compose.runtime.Composable "
internal const val COMPOSABLE _FQ _NAME = " androidx.compose.runtime.Composable "
/ * *
/ * *
@ -120,7 +121,9 @@ internal fun KtNamedFunction.isValidComposablePreviewFunction(): Boolean {
while ( annotationIt . hasNext ( ) && ! ( hasComposableAnnotation && hasPreviewAnnotation ) ) {
while ( annotationIt . hasNext ( ) && ! ( hasComposableAnnotation && hasPreviewAnnotation ) ) {
val annotation = annotationIt . next ( )
val annotation = annotationIt . next ( )
hasComposableAnnotation = hasComposableAnnotation || annotation . fqNameMatches ( COMPOSABLE _FQ _NAME )
hasComposableAnnotation = hasComposableAnnotation || annotation . fqNameMatches ( COMPOSABLE _FQ _NAME )
hasPreviewAnnotation = hasPreviewAnnotation || annotation . fqNameMatches ( DESKTOP _PREVIEW _ANNOTATION _FQN )
hasPreviewAnnotation = hasPreviewAnnotation ||
annotation . fqNameMatches ( DESKTOP _PREVIEW _ANNOTATION _FQN ) ||
annotation . fqNameMatches ( COMMON _PREVIEW _ANNOTATION _FQN )
}
}
return hasComposableAnnotation && hasPreviewAnnotation
return hasComposableAnnotation && hasPreviewAnnotation