CM6: Dynamically change extensions based on state field

I’m trying to configure my editor state so that the language and theme change when a specific state field changes. I tried creating a Facet and using compute() to return the correct extension based on the state field, but that seems to just register a FacetProvider in the extensions instead of the extension itself. Is there a way to do this, or do I always need to manually reconfigure the extensions?

You need to reconfigure them, probably using a labeled extension. See this for an example.

I’m also looking for a way to do this. It seems like the dispatch effect → statefield update → facet combine chain is working fine, but there isn’t a transaction after the facet has recalculated, so there’s nothing for the transaction extender to process, so it never gets to dispatch a new effect to reconfigure a compartment containing the theme.

Maybe there’s something I’m missing?

The editor configuration cannot depend on facets—that would be nice to have, but I found it pretty much impossible to implement in a reasonable way. So you’ll have to notice the conditions you’re interested in elsewhere, for example in a view plugin, and fire a new transaction when the configuration has to change.