I had a look at the code and it seems like currently Joplin provides to plugins some sort of compatibility layer that is supposed to implement CodeMirror 5 API on top of CodeMirror 6 but is not complete.
Given all that I am not going to make any changes to the plugin at this stage.