Start document tokenizer via CodeMirror API

I have a special CodeMirror mode (CM 5.48.0) that uses a global variable as a setting for how some parsing is performed. I need to programatically start the tokenizer when this variable is changed, and none of the CodeMirror API’s appear to do this.
I expected there to be an API like cm.redraw() that would do this.

Any help is greatly appreciated.

Setting the "mode" option with setOption should restart the mode.

This makes my workaround pointless! Awesome.

Thanks so much!