syntaxHighlighting

fun syntaxHighlighting(highlighter: Highlighter, fallback: Boolean = false): Extension

Wrap a highlighter in an editor extension that uses it to apply syntax highlighting to the editor content.

When fallback is true, the highlighter registers at the lowest precedence so that any non-fallback highlight style overrides it. This matches upstream CodeMirror's behavior where basicSetup includes defaultHighlightStyle as a fallback.