Syntax Highlighting by custom mode doesn't work in notebook cells but works in text documents

Hi, I’m making a Jupyter implementation of the Eclipse Epsilon family of languages, I have written a Java kernel based on Spencer Park’s basekernel, written a kernel.json, and both Jupyter Notebook and Jupyter lab can start up and communicate with the kernel.

The problem now is that I want to add Syntax Highlighting to the notebook cells, I started this intending to write a nbextension, but I read that the labextension api is better and more future-secure so I wrote that instead. I’m following the example of robotmode which was mentioned several times to people asking about Syntax Highlighting here and on github issues.

Most of the work is done by :

export function defineEolMode({CodeMirror}: ICodeMirror) {
    //@ts-ignore
    CodeMirror.defineSimpleMode<String,any>("eol",{
        start: [
            {regex: "operation",token: "keyword"},
            {regex: /[0-9]+/, token: "number"}
        ]
    });
    CodeMirror.defineMIME('text/x-eol','eol');

    CodeMirror.modeInfo.push({
        ext:  ['eol'],
        mime: 'text/x-eol',
        mode: 'eol',
        name: 'Epsilon Object Language'
    })
}

And the entrypoint of the extension calls it like :

const plugin: JupyterFrontEndPlugin<void> = {
  id: 'Epsilon_Highlight:plugin',
  autoStart: true,
  requires: [ICodeMirror],
  activate: (app: JupyterFrontEnd, codeMirror: ICodeMirror) => {
    console.log('JupyterLab extension Epsilon_Highlight is activated!');
    defineEolMode(codeMirror);
    console.log("I'm done now");
  }
};

When I make a new notebook and open it as json, I see that my kernel returns a language_info object like :

"language_info": {
   "codemirror_mode": "eol",
   "file_extension": "eps",
   "mimetype": "text/x-eol",
   "name": "Epsilon"
  }

So in theory, I should see the highlighting, but I don’t. The plugin is loaded, I can see its logs in the browser dev console, I can also see the name of the mode in the menu View -> Text Editor Syntax Highlighting, but it’s all greyed out. If I open a text document and give it a .eol file extension, syntax highlighting works fine and the View -> Text Editor Syntax Highlighting is not greyed out. But in the notebook, the mode won’t activate no matter what I do.

Please help ?