airbnb / Showkase

🔦 Showkase is an annotation-processor based Android library that helps you organize, discover, search and visualize Jetpack Compose UI elements
https://medium.com/airbnb-engineering/introducing-showkase-a-library-to-organize-discover-and-visualize-your-jetpack-compose-elements-d5c34ef01095
Apache License 2.0
2.08k stars 106 forks source link

PreviewParameters don't work with Kotlin 1.9 #343

Closed barry-irvine closed 1 month ago

barry-irvine commented 11 months ago

When upgrading to Kotlin 1.9, any functions that have a preview parameter fail to process correctly.

com.airbnb.android.showkase.processor.exceptions.ShowkaseProcessorException: Make sure that the @Composable functions that you annotate with the ShowkaseComposable annotation only have a single parameter that is annotated with @PreviewParameter.

This is what my function looks like (and it works fine with Kotlin 1.8.22).

@ShowkaseComposable(name = "Small Badge", "Attraction List Item", "Loaded")
@Composable
fun ShowkasePreviewAttractionListItemSmallBadge(
    @PreviewParameter(
        AttractionSummaryPreviewParameterProvider::class,
        limit = 1
    ) attraction: Attraction
) {
    MyTheme {
        MyComposable(attraction)
    }
}
k0siara commented 6 months ago

Any updates on this one?