Is there a way to dynamically remove/disable extension?

Hello. I saw the examples in the documentation are getting more and more detailed, thanks for the hard work! However, I wonder if there is a way to dynamically remove/disable a certain extension?

The use case is to switch from a language to plain text, but compartment.reconfigure only accept extension and passing an empty [] doesn’t seem to work.


codemirror6 - vanilla - CodeSandbox

Reconfiguring with [] should work. Are you dispatching a transaction with the resulting effect?

Yes. I posted a minimum reproducible codes here: codemirror6 - vanilla - CodeSandbox

The reconfiguration was going through, but the highlighter was getting confused by the lack of new tree and preserving the old highlighting decorations. @codemirror/highlight 0.19.2 should fix this.

1 Like

Many thanks!