Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No methods to use Tab instead of Enter to accept a suggestion in Jupyter LSP Code Completion? #1087

Open
blackpancake opened this issue May 28, 2024 · 2 comments

Comments

@blackpancake
Copy link

blackpancake commented May 28, 2024

Description

I’ve noticed that when I use autocomplete in JupyterLab running in the browser, the Language Server Protocol (LSP) defaults to using Enter as the shortcut key to accept a selected suggestion, while Tab and the up/down arrows can be used to scroll through the list of suggestions. This is contrary to my usage habits in other editors like VSCode, where pressing Tab always accepts the suggestion.
I'm finding methods to change it.

image
LSP extension uses a tab as the shortcut key to accept a selected suggestion only when there is just one candidate(enumerate). This matches my usage habits in VSCode.

image

But when there are many candidates(abs, all, any,..), pressing the tab only results in selecting the next candidate instead of accepting "abs".It is the Enter that would make it accepted. That's odd.

what I did:

  1. Open JupyterLab and click on the Settings dropdown menu.
  2. Select Advanced Settings Editor.
  3. Select Keyboard Shortcuts.

I’ve searched through the entire Keyboard Shortcuts, but I couldn’t find a command called ‘Accept a suggestion’, nor could I find an option to change its keybinding. Is there a way to make the behaviors in these two situations consistent?

Information

Version:

$jupyter --version
Selected Jupyter core packages...
IPython          : 8.24.0
ipykernel        : 6.29.4
ipywidgets       : not installed
jupyter_client   : 8.6.2
jupyter_core     : 5.7.2
jupyter_server   : 2.14.0
jupyterlab       : 4.2.1
nbclient         : 0.10.0
nbconvert        : 7.16.4
nbformat         : 5.10.4
notebook         : not installed
qtconsole        : not installed
traitlets        : 5.14.3
$python -V
Python 3.11.9

Some additional and geeky information: the jupyter lab was deployed on Termux.

Browser: Microsoft Edge Version 125.0.2535.67 (official version) (64 bit)

System: Windows 10

@krassowski
Copy link
Member

I agree that the keybinding for accepting completions should be customizable. The relevant codebase however is in JupyterLab, not in this extension. Can you open an issue over at https://github.com/jupyterlab/jupyterlab/issues? I can then provide some pointers on how to implement this if you are interested in contributing.

@blackpancake
Copy link
Author

jupyterlab/jupyterlab#12583

I agree that the keybinding for accepting completions should be customizable. The relevant codebase however is in JupyterLab, not in this extension. Can you open an issue over at https://github.com/jupyterlab/jupyterlab/issues? I can then provide some pointers on how to implement this if you are interested in contributing.

And I find this is indeed a long-standing issue: jupyterlab/jupyterlab#12583
(opened on May 16, 2022 · 8 comments)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants