Warn if a user is using an attribute modifer within a component style (and offer assistance to extract it to the extraModifiers parameter)
// Before
val SomeStyle by ComponentStyle.base {
Modifier.id("id").size(...)
^^
"id" is an attribute modifier and not valid inside a ComponentStyle, which can only reference style modifiers
}
// After refactoring
val SomeStyle by ComponentStyle.base(extraModifiers = { Modifier.id("id") }) {
Modifier.size(...)
}
Also support alt base syntax:
// Before
val SomeStyle by ComponentStyle {
base { Modifier.id("id") }
}
// After refactoring
val SomeStyle by ComponentStyle(extraModifiers = { Modifier.id("id") }) {
base { Modifier.size(...) }
}
For attribute modifiers that AREN'T in the base block, do NOT offer to refactor. Just show the warning.
val SomeStyle by ComponentStyle {
hover { Modifier.id("id").size(...) }
^^
}
Warn if a user is using an attribute modifer within a component style (and offer assistance to extract it to the extraModifiers parameter)
Also support alt base syntax:
For attribute modifiers that AREN'T in the base block, do NOT offer to refactor. Just show the warning.