varabyte / kobweb-intellij-plugin

An official IntelliJ IDE plugin to include Kobweb-specific enhancements and understanding to your project
Apache License 2.0
12 stars 2 forks source link

Show actions for handling a `private val ComponentStyle/ComponentVariant/Keyframes` #27

Open bitspittle opened 10 months ago

bitspittle commented 10 months ago

See the important note in this section: https://github.com/varabyte/kobweb?tab=readme-ov-file#componentstyle

In other words, detect this case:

private val SomeStyle by ComponenStyle

then put a warning on the "private" keyword and add two actions the user can take

1) Remove the "private" modifier 2) Introduce an initSilk method (or add to the end of an existing one if already defined)

@Suppress("PRIVATE_COMPONENT_STYLE")
private val SomeCustomStyle by ComponentStyle { /* ... */ }

@InitSilk
fun registerPrivateStyle(ctx: InitSilkContext) {
  ctx.theme.registerComponentStyle(SomeCustomStyle)
}