microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.72k stars 765 forks source link

Pylance error message appears in Chinese despite English language settings #6628

Open vani-lu opened 2 days ago

vani-lu commented 2 days ago

Environment data

Code Snippet

My pylance seems to be crashing because some reference error in Copilot chat. Most of the error messages are in English, consistent with my system language and VSC display language. But the "Pylance crashes..." error which is both prompted by a pop-up and shown in the output is in Chinese.

2024-11-04 15:11:04.223 [info] Error: Debug Failure. Notebook file should not be passed to getWorkspaceForFile: vscode-chat-code-block:/c%3A/Users/admin/Documents/baba-variants-datastore/manipulation.ipynb?8a7a5bf7-bea8-4ad8-afe8-784da3e70450
    at _0x3ac4ca.getWorkspaceForFile (c:\Users\admin\.vscode\extensions\ms-python.vscode-pylance-2024.10.1\dist\server.bundle.js:1:1008842)
    at c:\Users\admin\.vscode\extensions\ms-python.vscode-pylance-2024.10.1\dist\server.bundle.js:1:1026902
    at Array.map (<anonymous>)
    at _0x3ac4ca._filterResultsToCurrentWorkspace (c:\Users\admin\.vscode\extensions\ms-python.vscode-pylance-2024.10.1\dist\server.bundle.js:1:1026819)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:545:9)
    at processTimers (node:internal/timers:519:7)
    at c:\Users\admin\.vscode\extensions\ms-python.vscode-pylance-2024.10.1\dist\server.bundle.js:1:1024304

2024-11-04 15:11:04.234 [info] [Error - 15:11:04] Server process exited with code 1.
2024-11-04 15:11:04.235 [info] [Error - 15:11:04] Pylance 在过去 3 分钟内崩溃了 5 次。Pylance 不会重启。有关更多详细信息,请查看[此链接](https://aka.ms/AApf7ox)。

Of course the message itself is clear in its content. But I want to know how does pylance decide the language to output, because it feels quite awkward that the extension seemingly knows where I am.

StellaHuang95 commented 2 days ago

Thanks for reaching out, this might be a duplicate of https://github.com/microsoft/vscode/issues/230172. Are your repro steps the same as in that issue? If not, could you please provide your steps and some sample code? Thanks!

vani-lu commented 14 hours ago

Thanks for reaching out, this might be a duplicate of microsoft/vscode#230172. Are your repro steps the same as in that issue? If not, could you please provide your steps and some sample code? Thanks!

@StellaHuang95

For reproducing the Debug Failure error

Message: Request textDocument/documentSymbol failed with message: Debug Failure. Notebook file should not be passed to getWorkspaceForFile: vscode-chat-code-block:/home/vani/projects/baba-main-datastore/performance/resolution_compare_manipulations.ipynb?219c2207-24cf-49d0-a909-b783549d943f

Yes, my repro steps is the same: ctrl+I for inline copilot chat and then View in chat to open it in sidebar.

For pylance crashing

After some testing, I think it only happens when I open specific chat session. The chat session took place before the latest update of Copilot. I think I met this problem purely out of chance because my sidebar defaults to open that session after update (I have no idea why). In normal usage, it should open with a new chat and I very rarely look at past chat sessions.

The output is filled with dozens of texts including english, traditional/simplified chinese, korea etc from c:\Users\admin\.vscode\extensions\ms-python.vscode-pylance-2024.10.1\dist\server.bundle.js. I don't know if this is normal after crashing.Python Language Server.log