Diary 2022-06-17

By Max Woerner Chase

All right, I did a bit of writing and editing today, so there's that.

I am blanking on anything else to say right now.

Maybe I'd like to do a little more research into my Jupyter/CodeMirror complaints.

So, according to CodeMirror, I need a custom command to do what I want. So, that's "adding [a property] to the CodeMirror.commands object". Specifically, I need to change the newlineAndIndent command.

Before I get too much further, I need to figure out which version of CodeMirror Jupyter Lab is using. Looks like... ~5.61.0? So, I should see what the code is like at version 5.61.1, probably.

Anyway, in order to use that information, I need to have access to the relevant CodeMirror object, which seems a bit confusing to me, currently.

I think I need to write some TypeScript that exports a function; eventually in its own tiny module. Then, a Jupyter extension that wraps that function by... injecting it into the CodeMirror object associated with cells using the ipython mode? (For bonus points, figure out how to change the tokenLexer function to dedent on ... and raise as well (but perhaps not raise NotImplementedError))

I think I'm understanding this a bit better; the key insight that's bringing lots of things together is that Jupyter appears to be using a version of CodeMirror that's over a year old, which made my bug report, um, incredibly pointless? Oops. Sorry.

Anyway, I'll get back to all of this later; for now, I should get ready for bed.

Good night.