While reviewing the patch for T274274: FileImporter constructs EditPage for a special page, I realized the exact same lines of code are responsible for another issue: As of now, MediaWiki-extensions-CodeMirror doesn't show up in the WikiEditor (2010) toolbar when editing the wikitext while importing a file. This is because CodeMirror thinks …
- the page is not in edit mode, and
- it's not a wikitext page but a special page.
Context for devs: What our WikitextEditor class does is actually re-implementing a small piece of the EditPage class – the piece that is responsible for running the EditPage::showEditForm:initial hook. We need to fake the context just so much that extensions relying on this hook are satisfied.