Wikitext syntax highlighting depends on extensions used, since extensions can enhance the wikitext parser adding their own tags and parser functions. And since only an extension knows about syntax that are used inside it own tags or parser functions, one should provide own modes for text highlighting, otherwise it will displayed as is (plain text).
I think the better way is allow to integrate through extension.json file.
I know only one possible way to merge several values from different extensions (such as list of resource modules required for CodeMirror) , it is global variable (config property in extension.json) but it seems too ugly solution..
Seems extension schema should be extended with CodeMirrorResourceModules property...
As I see the better solution:
Extensions will create resource modules for CodeMirror and register ones in extension.json files (as ResourceModules)
CodeMirror will call a hook for get list of such modules from extensions (it will very cheap and only for edit page cases) or in the future list of CodeMirror modules can be integrated with extension.json file.
CodeMirror loads the modules and they will add information about how to highlight text inside extension tags.