Skip to content

Copy LAST_JEDI_COMPLETIONS to cell document so that completionItem/resolve will work #663

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

hjr265
Copy link

@hjr265 hjr265 commented Jul 28, 2025

Let's say I am running this LSP server with Ruff (for linting) and Jedi (for autocompletion, with eager off). I then open a notebook document with a few cells in it.

I open the document (and the cells) with the notebookDocument/didOpen method.

Now, I request completion using the method textDocument/completion and receive the completion items as expected.

So far, so good.

Now, if I attempt to resolve one of the completion items using the completionItem/resolve method, I receive an empty array as a result.

This issue occurs because PyLSP concatenates cells of notebook documents into a temporary document and then uses it to generate completion items. That temporary document has a "randomly" generated UUID as its URI. When generating completion items, the shared data "LAST_JEDI_COMPLETIONS" is stored on this temporary document.

However, when the client sends back any "completion item" to be resolved, it looks for "LAST_JEDI_COMPLETIONS" shared data on the actual cell document, where this shared data is not present, and the request to "resolve" fails.

This PR copies the "LAST_JEDI_COMPLETIONS" shared data from the temporary document to the cell document at the end of the "completion" request.

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

Successfully merging this pull request may close these issues.

1 participant