Description
Background
This is the task to formally propose replacing CodeEditor with MediaWiki-extensions-CodeMirror on Wikimedia wikis (T373711 was getting too noisy). So far for users of the "Improved Syntax Highlighting" beta feature – which forces use of CodeMirror over CodeEditor – reception has largely been positive. We have a goal of shipping CM6 by MW 1.46 in May–June 2026, and it would make configuration and maintenance easier if we went forward with replacing CodeEditor at the same time.
Note however this initially will only effect pages, i.e. when editing JS/CSS/JSON/Vue and Lua. See below for the outstanding integrations that still need addressing.
Why?
Pros
- User preferences are consistent across all editors (for CodeEditor that is/was T261118)
- User experience is more consistent across all editors
- JavaScript integrations from extensions, gadgets, etc. work the same for all editors (even the 2017 editor, to a degree)
- Maintenance is simpler as everything is under one roof
- Users can opt to have syntax highlighting without WikiEditor (i.e. the toolbar), if they so desire
- Better autocompletion
- Better linting tools (T373711#10350551), including linting against unsupported JS/CSS (T394965)
- Dark mode support
- Fully localized
Cons
- Complete feature parity is unlikely, but we should be able to port over whatever users consider the most important features
- Fixes something that arguably isn't broken (apart from perhaps the outdated linters)
- If something in CodeMirror breaks, it may affect editing in all content models (counterpoint to the "pro" above of being able to fix everything at once)
Other integrations
We plan to tackle these as well, so that eventually CodeEditor is not used at all and can be removed from WMF wikis. Until then, these can live happily as-is, and are not blockers for replacing CodeEditor for editing pages () directly on the wiki.
- T399673: Add CodeMirror mode for AbuseFilter syntax
- T400014: Add ve.ui.MWCodeMirrorEditorWidget for CodeMirror support in VisualEditor's code editor
- T400015: Add CodeMirror integration in WikiLambda as an alternative to CodeEditor
Blockers
Anything deemed a potential blocker should be a subtask of this task. Note that some things like T413457, T419331 and T412883 are on our radar but not considered blockers for the CodeEditor-to-CodeMirror switchover.
Details
- Due Date
- Wed, Apr 15, 4:00 AM
Related Objects
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Open | Feature | None | T166098 Syntax sensitive and highlighting source code editor for template code wanted | ||
| Resolved | Feature | Bhsd | T95100 Add autocompletion to CodeMirror extension | ||
| Resolved | Feature | MusikAnimal | T181677 Implement syntax highlight for U+00A0 (no-break space, nbsp) | ||
| Resolved | Feature | MusikAnimal | T301615 Show syntax highlighting on View Source/protected pages | ||
| Resolved | MusikAnimal | T214989 Allow CodeMirror to be used for other textareas with WikiEditor | |||
| Open | Goal | None | T259059 Upgrade to CodeMirror 6 | ||
| Open | None | T419332 Replacing CodeEditor with CodeMirror by MW 1.46 | |||
| Resolved | MusikAnimal | T419337 Allow CodeMirror preferences to differ between wikitext and non-wikitext |
- Mentioned In
- T259059: Upgrade to CodeMirror 6
T373711: Add support for Scribunto, JavaScript, CSS, JSON and Vue to CodeMirror 6 - Mentioned Here
- T261118: Save code editor settings / preferences across pages
T373711: Add support for Scribunto, JavaScript, CSS, JSON and Vue to CodeMirror 6
T394965: Provide API-powered linting of supported languages in CodeMirror
T399673: Add CodeMirror mode for AbuseFilter syntax
T400014: Add ve.ui.MWCodeMirrorEditorWidget for CodeMirror support in VisualEditor's code editor
T400015: Add CodeMirror integration in WikiLambda as an alternative to CodeEditor
T412883: Offer indentation grid lines in CodeMirror
T413457: Auto-linking in CSS/JavaScript comments
T419331: Browserify eslint-plugin-vue for realtime linting while editing Vue pages
