| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
completionItem/resolve will work
|
Thanks @hjr265 for your contribution! It looks good to me, but I'd like @krassowski to review it because this could impact JupyterLab-LSP. |
Sorry, something went wrong.
|
No objections from my side - looks like fine workaround, though I would also suggest adding a test in case if it needs to be reworked later on. |
Sorry, something went wrong.
|
Thanks @krassowski! Let me add a test for this. |
Sorry, something went wrong.
|
@ccordoba12 I have added a test. Please let me know if there is anything else. |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good to me, thanks @hjr265!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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.