Skip to content

Commit 26a3031

Browse files
authored
Add Material 3 chips as content emitters (#633)
Add the following Material 3 chips to `ComposableEmittersList`: `AssistChip`, `ElevatedAssistChip`, `FilterChip`, `ElevatedFilterChip`, `InputChip`, `SuggestionChip`, `ElevatedSuggestionChip`. Mirrors the shape of #613 (Material 3 dividers) and #632 (Material 3 `NavigationBar` / `NavigationBarItem`). Without these entries, `MultipleContentEmitters` and `ModifierNotUsedAtRoot` rely on the `containsComposablesWithModifiers()` fallback in `KtCallExpression.emitsContent`, which only matches when the call site passes a `modifier` argument. Calls like `AssistChip { ... }` (no explicit modifier forwarded) currently slip through. Adding the names to the emitters list closes that gap.
1 parent 14b3900 commit 26a3031

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • rules/common/src/main/kotlin/io/nlopez/compose/core/util

rules/common/src/main/kotlin/io/nlopez/compose/core/util/Composables.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,17 +298,24 @@ private val ComposableEmittersList by lazy {
298298
"TextButton",
299299
"TopAppBar",
300300
// androidx.compose.material3 (there are some dupes with M2 names so only adding the new ones)
301+
"AssistChip",
301302
"DatePickerDialog",
302303
"DockedSearchBar",
304+
"ElevatedAssistChip",
305+
"ElevatedFilterChip",
306+
"ElevatedSuggestionChip",
303307
"ExposedDropdownMenuBox",
308+
"FilterChip",
304309
"HorizontalDivider",
310+
"InputChip",
305311
"InputField",
306312
"ModalBottomSheet",
307313
"NavigationBar",
308314
"NavigationBarItem",
309315
"PlainTooltip",
310316
"RichTooltip",
311317
"SearchBar",
318+
"SuggestionChip",
312319
"VerticalDivider",
313320
// Accompanist
314321
"BottomNavigation",

0 commit comments

Comments
 (0)