This module provides syntax highlighting for languages that are not MediaWiki
content models. Each mode is exposed as a method that returns a
LanguageSupport instance that can be used with the CodeMirror
constructor.
These languages have no linting or autocomplete beyond what the upstream
packages provide. For MediaWiki content models such as JavaScript, CSS, JSON,
Lua, Vue and HTML, use ext.CodeMirror.modes.
For wikitext, use
ext.CodeMirror.mode.mediawiki.
Everything in this module is downloaded together, so prefer
ext.CodeMirror.modes where it has the
language you need.
Example
const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes.extended' ] );
const CodeMirror = require( 'ext.CodeMirror' );
const { python } = require( 'ext.CodeMirror.modes.extended' );
const cm = new CodeMirror( myTextarea, python() );
cm.initialize();