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

Figure out way to let jupyter query pylance for its list of completions #19129

Closed
rchiodo opened this issue May 11, 2022 · 2 comments
Closed
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. feature-request Request for new features or functionality partner ask

Comments

@rchiodo
Copy link

rchiodo commented May 11, 2022

I just thought of something. This whole thing is going to break de-duplication that we do for completions we get back from the jupyter kernel.

Right now, since the jupyter extension creates its own pylance, we can get the completions from pylance and remove those from jupyter that are the same thing.

After this change, the pylance server won't be started by jupyter and we won't be able to ask it directly for completions.

We need some way to find the specific completion provider (or the language client). So I think we'd need yet another API to pass the language client through to jupyter.

We could do that after this though.

This is the line where we ask pylance directly for its completions:
https://github.com/microsoft/vscode-jupyter/blob/8f7f38e2bc664836af236e8e2ad9f1b85130c3c9/src/intellisense/pythonKernelCompletionProvider.node.ts#L222

We'd need some way to get to this language client from jupyter still (well unless VS code has an API to return a specific completion provider but I don't think it does).

Originally posted by @rchiodo in #19087 (comment)

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label May 11, 2022
@rchiodo
Copy link
Author

rchiodo commented May 11, 2022

Once Python owning Pylance goes in, Jupyter can no longer get the list of completions from Pylance directly. Jupyter uses this to dedupe the results we get from the jupyter kernel.

Ideas:

  • Query vscode for them but set a recursion flag in jupyter to ignore the request? This might work. Might be tricky to get the timing right as the request is async so not sure if it comes from jupyter or a legit request
  • Pass the languageclient to the jupyter extension so it can query pylance directly (or jedi for that matter). Downside here is the version of the languageclient has to be in sync.
  • Pass something smaller - just a method to use for querying completions. Method should be able to use just vscode types so easier to keep in sync.

@karthiknadig karthiknadig added feature-request Request for new features or functionality area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. needs proposal Need to make some design decisions partner ask and removed triage-needed Needs assignment to the proper sub-team labels May 12, 2022
@luabud
Copy link
Member

luabud commented Dec 14, 2023

There was a change made in Pylance to handle this for notebooks so closing this.

@luabud luabud closed this as completed Dec 14, 2023
@github-actions github-actions bot removed the needs proposal Need to make some design decisions label Dec 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. feature-request Request for new features or functionality partner ask
Projects
None yet
Development

No branches or pull requests

3 participants