Background
This feature is part of the WMDE TechWish project "Making working with templates easier". It is specifically about improving template syntax and the ability to create and maintain templates. It will be implemented as a part of the syntax highlighter of the CodeMirror extension.
Requirements
- Enable standard bracket matching CodeMirror add-on
- Highlight a single bracket and its match/pair, including [ { ( type brackets, when cursor is next to a bracket (standard behavior)
- Add section highlighting, where a cursor at an arbitrary position highlights the two most innermost brackets, see mock below.
- All of the above requirements must be fully functional in the 2010 wikitext editor, looking and behaving the same way
- Implement behind feature flag
- Enable in syntax highlighter by default
Bracket matching | Section highlighting |
Scope
Excludes:
- VisualEditor, see T269094
- Highlighting groups of linked brackets in either pairs or triples, for example {{{ }}} or [[ ]]
- Tag matching
- Unmatched bracket error highlighting
Implementation plan
Release on small number of wikis first (see T270238), validate, then roll out to all wikis.
Release schedule is still TBD (likely Jan/Feb 2021). Do not release until date has been set by Product.
Communication
Project page on meta
Notes:
- Exiting addon we want to use: https://github.com/codemirror/CodeMirror/blob/master/addon/edit/matchbrackets.js
- Note it's already ported to version 6 (a.k.a. "next"): https://github.com/codemirror/codemirror.next/blob/master/matchbrackets/src/matchbrackets.ts
Existing commits from prototyping