Open joelostblom opened 6 years ago
I had an initial go at this, but couldn't yet make it work. Maybe someone else is interested at picking this up, so here's where I got to:
Source for the autocompletion menu is here: https://github.com/jupyterlab/jupyterlab/tree/master/packages/completer/src Cycling through the menu works via KeyEvents being processed in https://github.com/jupyterlab/jupyterlab/blob/master/packages/completer/src/widget.ts#L133. The widget just directly checks key codes at the moment.
I've then tried to somehow get a handle onto the completer widget so we could maybe inject a KeyEvent, via something like this:
commands.addCommand('log-test', {
label: 'Log Test',
execute: args => {
const current = getCurrent(args);
console.log(current);
},
isEnabled
});
commands.addKeyBinding({
selector: '.jp-Completer',
keys: ['Ctrl N'],
command: 'log-test'
});
However, it seems that selector doesn't match anything and my logging function never gets called. It works with other selectors, like .jp-Notebook.jp-mod-editMode
.
So I've run out of time/ideas for tonight, but it'd be really nice to get this working.
There is also an issue about this on the jupyterlab issue tracker https://github.com/jupyterlab/jupyterlab/issues/5863
Hi, Is it possible to add support for using ctrl-n/p (or maybe ctrl-j/k) to navigate down and up the tab autocompletion menus?