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.

@ccordoba12 ccordoba12 changed the title Copy LAST_JEDI_COMPLETIONS to cell document so that completionItem/resolve will work Copy LAST_JEDI_COMPLETIONS to cell document so that completionItem/resolve will work Jul 30, 2025
@ccordoba12
Copy link
Member

Thanks @hjr265 for your contribution! It looks good to me, but I'd like @krassowski to review it because this could impact JupyterLab-LSP.

@ccordoba12 ccordoba12 added this to the v1.13.1 milestone Jul 30, 2025
@ccordoba12 ccordoba12 added the bug Something isn't working label Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy