The CodeMirror extension tokenizes wikitext differently of MW Core Parser.
It is not a problem for plain wikitext, but for complex wikitext needed a different approach. (Example T108455 and T108450)
The main difference is that CodeMirror looks for tokens successively in text and Parser looks for tokens in whole text.
The problem is that the string at the beginning may seem like a token, but in fact it isn't.
Incorrect syntax highlighting complicates the visual perception, but rolling back for correction reduces performance.
Perhaps, the best way is to use the combined method, since when editor is writing an article, the end is not known, but probably it will be more comfortable when wikitext is highlighted.
Or necessary automatically add closing tokens, for example if editor wrote '{{', need to add '}}' after cursor.