Page MenuHomePhabricator

Add ve.ui.MWCodeMirrorEditorWidget for CodeMirror support in VisualEditor's code editor
Open, Needs TriagePublic

Description

There are efforts to explore MediaWiki-extensions-CodeMirror as an alternative for CodeEditor across the wikiverse. CodeMirror integration in VisualEditor would be required for this effort to be feature-complete.

There is a ve.ui.MWAceEditorWidget that is used to power syntax highlighting in VisualEditor. This widget is not used directly in VE, but by other extensions integrating with VE:

Presumably, in order to have CodeMirror be a suitable drop-in replacement, we'd need to add more language modes, such as those that Extension:SyntaxHighlight supports.

Additionally, we'll need configuration flags to control the use of CodeMirror over CodeEditor. Other extensions are doing this with a pair of flags, which in this case would be $wgVisualEditorUseCodeEditor and $wgVisualEditorUseCodeMirror.