Skip to content
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

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

Open
vani-lu opened this issue Nov 4, 2024 · 3 comments
Open
Assignees
Labels
user responded Was "waiting for user response" and they responded

Comments

@vani-lu
Copy link

vani-lu commented Nov 4, 2024

Environment data

  • Pylance version: v2024.10.1
  • OS and version: Windows 11 Pro 23H2 Build 22631.4317
  • Python version (& distribution if applicable, e.g. Anaconda): 3.9.8 Anaconda

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.

  • My VSCode display language is English. I have not installed a Chinese language pack.
  • My Windows display language is also English. But I have "English" and "Chinese" both set as the preferred language, with English ranking first.
  • Windows Region is set to China, but Regional Format is "English (en-US)" respecting my display language
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Nov 4, 2024
@StellaHuang95
Copy link
Contributor

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 StellaHuang95 added waiting for user response Requires more information from user and removed needs repro Issue has not been reproduced yet labels Nov 4, 2024
@vani-lu
Copy link
Author

vani-lu commented Nov 6, 2024

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

@github-actions github-actions bot added user responded Was "waiting for user response" and they responded and removed waiting for user response Requires more information from user labels Nov 6, 2024
@StellaHuang95
Copy link
Contributor

Thanks! The debug failure you encountered is what caused Pylance to crash. The text you saw at the end of the logs is likely a dump of the source at the time of the crash; the actual call stack appears right after the Debug Failure message. This is the same issue as the one linked, triggered by the viewInChat command. I’ll follow up on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user responded Was "waiting for user response" and they responded
Projects
None yet
Development

No branches or pull requests

3 participants