I am using Codemirror 6. I am having a problem with changing a language after the editor is mounted. Here is how I am mounting and attempting to change the language:
const languageConf = new Compartment()
const view = new EditorView({
extensions: [
basicSetup,
EditorState.readOnly.of(this.readOnly),
javascript()
],
doc: "const a = 2",
parent: element
})
view.dispatch({
effects: languageConf.reconfigure(python())
})
But there is no luck with it. Can anybody show me how to correctly update the language?