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

Feature: Support Multiple Autocompleters #440

Closed
mlucool opened this issue Dec 30, 2020 · 2 comments
Closed

Feature: Support Multiple Autocompleters #440

mlucool opened this issue Dec 30, 2020 · 2 comments
Labels
enhancement New feature or request feature:completion

Comments

@mlucool
Copy link

mlucool commented Dec 30, 2020

Elevator Pitch

While LSP has a lot of great features, sometimes I don't want to use its autocompleter. Other autocompleters offer different features that are better for certain workflows. LSP should let me choose my default autocompleter and change that per notebook.

Motivation

Consider this code:

def foo(a):
    if a:
        return A()
    return B()
x = foo(True)
# New cell
x.<tab>

IPykernel's autocomplete knows about runtime properties of objects, which I don't believe LSP does. This means I'll get autocomplete results for both A and B in the above example, but ipykernel will only show A. Another autocompleter is kite which uses ML to predict the best autocomplete results based on context (including more than just the function). Finally, LSP's autocomplete is (typically) fast and can be used without a running kernel.

All this is to say is that none of these are better than the rest, just different. Depending on my use case or personal preference, I'd like to be able to use other autocompleters without losing the rest of the features of LSP.

Design Ideas

Add a global setting that can store the "default" autocompleter then add a command to switch it per notebook. It's not clear if this feature should be requested on lab itself and LSP implement it or if this is all LSP specific....

@krassowski
Copy link
Member

Thanks, this is a good idea. We already combine results from both the kernel and the LSP but this is indeed problematic because either one of those can be slow and we need to wait for both to complete to display the result. Giving user the choice is the right thing. Enabling Kite is also a good idea. It was previously brought up in #236; since then we split the codebase making it more developer friendly to tackle those issues.

@krassowski krassowski added enhancement New feature or request feature:completion labels Dec 30, 2020
Carreau added a commit to Carreau/jupyterlab-lsp that referenced this issue Apr 27, 2021
Some use love LSP for many of its features, but prefer to keep
completions via the kernel.

This adds two boolean flags in the configuration to not send completions
request to LSP and not send completions requests to the kernel.

See jupyter-lsp#440
@mlucool
Copy link
Author

mlucool commented Jun 3, 2021

@mlucool mlucool closed this as completed Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature:completion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants