In JupyterLab 3.x and CodeMirror5, I could do
to set the codemirror mode for an individual cell.
How can I do the same in JupyterLab 4.x and CodeMirror 6? I see some code like
but not anything like `setOption(‘mode’). Should I follow
and do something like
This is what I do in jupyterlab-lsp:
I think I would support a pull request which exposes methods allowing to read from and update the language compartment in
Great! This solves half of the problem, but how can I set “options” to the mode? You know, in CodeMirror 5 mode can be an object like
mimetype alone cannot specify these options.
Indeed. If this is just a single boolean as in your example, one could argue that this should be a separate MIME type which could then register its own CodeMirror language support (I think there already should be a JSON mime type though).
But if you do have a valid use case for a more complex mode customization we should consider exposing the language compartment as previously mentioned (in which case lets move this discussion to GitHub).