Page MenuHomePhabricator

Investigation: Check CodeMirror's capabilities for more "distinct" syntax highlighting
Closed, ResolvedPublic

Description

This is mainly about making deeply nested templates with lots and lots of }}}}}}}} easier to navigate, e.g. via rainbow coloring or whatnot.

To do:

  • Look at the CodeMirror documentation to see what's even possible
  • Look at MediaWiki-extensions-CodeMirror
  • Check how the integration wiki core works
  • Check where the implementation (of the wikitext syntax highlighting) lives
  • Talk to WMF ComTech (sync, ask open questions)

Event Timeline

Keep in mind we ultimately plan to upgrade to CodeMirror 6, which is a complete rewrite that WMF helped fund. It is not API-compatible with the older version, so work put into the existing CodeMirror extension may have to be rewritten. @kaldari or @aezell may know more about when to expect the upgrade.

@MusikAnimal, thanks, that's incredibly valuable. Is there already a Phabricator ticket we can watch? The only one I can find is the older T176685: Update CodeMirror extension to CodeMirror library 5.30.

I think we will still do explorations, drafts, and possibly even smaller add-ons based on the current version 5. But we will definitely do this with the upcoming incompatibilities in mind.

By the way, I think it's still valuable to update the current 5.35.0 to the latest 5.56.0, so we don't develop against a possibly buggy version, don't you think? I created T258999 to do this.

I have created T259059: Upgrade to CodeMirror 6 as a placeholder for the CodeMirror 6 upgrade. I think the 5.56.0 update sounds great, if you think it's low-risk. We can probably help a little bit with testing, if you need it, but I should be clear Community Tech doesn't have many resources to devote to CodeMirror until version 6 is ready. My wild guess for when we'll start that effort is sometime late this year or early 2021. In the meantime, incorporating existing add-ons is probably worthwhile if it doesn't require significant work. Thanks for helping improve CodeMirror!

@Lena_WMDE I think this task can be resolved; the investigation portion is done. Just updated the implementation epic T261857: Implement bracket matching in CodeMirror behind a feature flag for bracket matching, and I guess we can make similar ones for the other related projects as/if we choose to take them forward.

Lena_WMDE claimed this task.