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

Installing jupyterlab-lsp and jupyter-lsp breaks the completer plugin #15649

Closed
divyansshhh opened this issue Jan 16, 2024 · 8 comments · Fixed by jupyter-lsp/jupyterlab-lsp#1036
Labels
bug pkg:completer status:Needs Triage Applied to new issues that need triage
Milestone

Comments

@divyansshhh
Copy link
Contributor

Description

I want to use the completions from the default completer extension and features from lsp but I don't want to use the lsp code completion. When I install jupyterlab-lsp and jupyter-lsp in my environment, I can't see any availableProviders in the completer extension settings.

Here's the screenshot -
image

Reproduce

  1. Install and launch jupyterlab
  2. Go to the completer extension settings. You'll see kernel and context providers are available.
  3. Install jupyter-lsp and jupyterlab-lsp
  4. Go to the completer extension settings again. You'll see that the kernel and context providers are no longer available.

Expected behavior

I expect the default completer extension to work regardless of lsp packages being installed or not.

Context

Versions used -

  • jupyterlab 4.0.10
  • jupyter-lsp 2.2.1
  • jupyterlab-lsp 5.0.1
@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Jan 16, 2024
@krassowski
Copy link
Member

I cannot reproduce this:

image

image

I expect the default completer extension to work regardless of lsp packages being installed or not.

Is there something which does not work?

I want to use the completions from the default completer extension and features from lsp but I don't want to use the lsp code completion

For now I would recommend disabling the @jupyter-lsp/jupyterlab-lsp:completion plugin,.

@krassowski
Copy link
Member

Are there any errors in the browsers JS console?

@divyansshhh
Copy link
Contributor Author

Is there something which does not work?

I'm not getting any completion suggestions when pressing Tab.

For now I would recommend disabling the @jupyter-lsp/jupyterlab-lsp:completion plugin,.

Yes, we intend to disable this for now.

Are there any errors in the browsers JS console?

No, there are no errors. Neither in the terminal nor in the browser console.

Any thoughts on why these completers are not present? I'm trying to make a better reproducer in the meantime.

FWIW, I tried doing a dev build and setting a breakpoint in the activate function of the default providers but the breakpoint never got triggered.

@divyansshhh
Copy link
Contributor Author

Here's a screen capture of this (if it helps) -

lsp.mp4

@divyansshhh
Copy link
Contributor Author

divyansshhh commented Jan 16, 2024

@krassowski can you disable @jupyter-lsp/jupyterlab-lsp:completion and then try to look into the completer-extension settings? I'm consistently able to reproduce this by toggling the jupyterlab-lsp:completion extension.

@krassowski
Copy link
Member

Yes, disabling @jupyter-lsp/jupyterlab-lsp:completion plugin does make it reproducible - thank you! Interesting, I will take a look.

@krassowski krassowski added this to the 4.0.x milestone Jan 16, 2024
@krassowski
Copy link
Member

The problem is in the jupyterlab-lsp extension; it disables @jupyterlab/completer-extension:base-service in disabledExtensions because it needs to augment the default providers slightly to work correctly in the context of document tranclusions, and to provide a unified UX regardless of completion source (overrides.ts).

There are a few solutions to consider:

  • (a) make it possible to disable a plugin from a plugin level rather than from an extension level; e.g. we could have:

    {
      "jupyterlab": {
         "disabledExtensions": [
            // short form
            "@org/core-extension:plugin-a",
            // proposed long form
            {"disable": "@org/core-extension:plugin-b", "ifEnabled": "@org/external-extension:plugin"}
        ]
      }
    }

    or we could add a new explicit stanza:

    {
      "jupyterlab": {
         "replacesPlugins": {
            "@org/core-extension:plugin-b", "@org/external-extension:plugin"
          }
      }
    }
  • (b) make the default completion providers extensible by using hooks; this would be better if multiple extensions want to make small tweaks in their behaviour

In the meantime I will make jupyterlab-lsp re-register the original providers in LSP when the completion plugin is disabled.

@krassowski
Copy link
Member

I opened a dedicated issue to discuss the (a) option: #15651 and there is
a draft PR working the issue around in jupyterlab-lsp: jupyter-lsp/jupyterlab-lsp#1036

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pkg:completer status:Needs Triage Applied to new issues that need triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants