Background
With CodeMirror 5, the CodeMirror object is in the global scope, making it simple for extensions to integrate with it. The 2017 wikitext editor (part of VisualEditor) does this with ve.ui.CodeMirrorAction.js and ve.ui.CodeMirrorTool.js, which live in MediaWiki-extensions-CodeMirror and registered as a PluginModule for VisualEditor. This needs to be migrated to work with CodeMirror 6.
Acceptance criteria
- Introduce the new temporary ext.CodeMirror.visualEditor.init module, which will load CodeMirror v5 or v6 based on $wgCodeMirrorV6
- Feature parity is not there with non-VE CodeMirror, but this is expected because the 2017 editor doesn't support variable-width characters. Short list of features not supported in the 2017 editor:
- Template folding
- Highlighting of non-printable control characters
- The keyboard shortucts are also different (expected), matching VE's rather than CM's













