pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

`inlineChat.viewInChat` command from notebook will cause pylance to crash

Open amunger opened this issue 1 year ago • 5 comments

  1. open a notebook and press ctrl+i to open the copilot inline chat
  2. ask for a code change and then run inlineChat.viewInChat on the response (ctrl+down) :bug: pylance crashes with bad request
2024-09-25 12:59:22.351 [error] Request textDocument/documentSymbol failed with message: Debug Failure. Notebook file should not be passed to getWorkspaceForFile: vscode-chat-code-block:/c%3A/src/test/ws1/1.ipynb?25fea62c-6c24-498f-993c-46a83def7b6f: Error: Request textDocument/documentSymbol failed with message: Debug Failure. Notebook file should not be passed to getWorkspaceForFile: vscode-chat-code-block:/c%3A/src/test/ws1/1.ipynb?25fea62c-6c24-498f-993c-46a83def7b6f
    at ae (c:\Users\aaron\.vscode-insiders\extensions\ms-python.python-2024.15.2024092501-win32-arm64\out\client\extension.js:2:2052314)
    at oe (c:\Users\aaron\.vscode-insiders\extensions\ms-python.python-2024.15.2024092501-win32-arm64\out\client\extension.js:2:2050274)
    at Immediate.<anonymous> (c:\Users\aaron\.vscode-insiders\extensions\ms-python.python-2024.15.2024092501-win32-arm64\out\client\extension.js:2:2046568)
    at processImmediate (node:internal/timers:483:21)

amunger avatar Sep 25 '24 20:09 amunger

Thanks for reporting, I am able to repro this.

StellaHuang95 avatar Sep 26 '24 17:09 StellaHuang95

Moving to triage, I think we might want to fix this before we ship?

rchiodo avatar Sep 30 '24 17:09 rchiodo

Not sure how many people are using it, this issue only repros when user clicks View in Chat in a notebook file. But I agree it's something we should fix sooner rather than later. Image

StellaHuang95 avatar Sep 30 '24 17:09 StellaHuang95

THe notebook in the chat window is messed up too for me. Maybe the chat window is passing the wrong file? Shouldn't it be passing us the cell and not the file?

Image

rchiodo avatar Sep 30 '24 17:09 rchiodo

Maybe the scheme is not supported? Running the same command in a regular python file doesn't crash Pylance but gives me a silent error. [Error - 10:54:20 AM] (25168) File or directory "vscode-chat-code-block:/" does not exist.

StellaHuang95 avatar Sep 30 '24 17:09 StellaHuang95

let me take a look. it looks like it is one of reason why pylance user do reload according to telemetry and vscode-chat-code-block is something I worked with before for copilot workspace changes.

heejaechang avatar Nov 07 '24 22:11 heejaechang

It seems that I am unable to use pylance now in my python project which contains notebooks. Is there a version I could roll back to, or a way to exclude notebooks from the pylance analysis?

cdiddy77 avatar Nov 08 '24 20:11 cdiddy77

This issue has been fixed in prerelease version 2024.11.101, which we've just released. You can find the changelog here: CHANGELOG.md

KacieKK avatar Nov 19 '24 22:11 KacieKK