Closed bdknguyen closed 1 week ago
did you install the basedpyright pypi package? or are you just using the version of the language server that's bundled with the vscode extension?
if you're trying to use the version from pypi, it's possible that your installation got corrupted. this can happen if the vscode extension was running while you updated the package. try deleting and recreating your venv and see if that fixes it.
though from those logs it looks like it's using the bundled version, which is quite concerning if that's crashing. can you go to Help > Toggle Developer Tools
and see if it logged anything noteworthy to the console?
Thanks for getting back to me! I installed the BasedPyright pypi package in my conda environment, but from looking at the console log it seems like the VSCode extension is unable to find it. However, I managed to find it in miniconda3\Lib\site-packages
.
Anyway, here are some noteworthy things I found in the console log:
workbench.desktop.main.js:660 ERR spawn c:\Users\nguye\.vscode-oss\extensions\ms-python.python-2024.12.3-universal\python-env-tools\bin\pet.exe ENOENT: Error: spawn c:\Users\nguye\.vscode-oss\extensions\ms-python.python-2024.12.3-universal\python-env-tools\bin\pet.exe ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
workbench.desktop.main.js:97 [Extension Host] failed to find pyright executable, falling back to bundled: C:\Users\nguye\miniconda3\basedpyright-langserver.exe
E @ workbench.desktop.main.js:97
workbench.desktop.main.js:97 [Extension Host] using bundled pyright
workbench.desktop.main.js:820 The basedpyright server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
onDidChangeNotification @ workbench.desktop.main.js:820
hmm, nothing helpful there. the only noteworthy thing i can see is this from the first log you posted:
Error: Unhandled method client/registerCapability
at handleResponse (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.16.0-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:561:48)
at handleMessage (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.16.0-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:398:20)
at Immediate.<anonymous> (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.16.0-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:368:30)
at processImmediate (node:internal/timers:478:21)
i have no idea what could be causing it. though. does the issue persist if you uninstall and reinstall the extension?
Unfortunately yes, the issue still pops up even when I uninstall and reinstall the extension. The recent update to v1.17.0 didn't resolve it either.
-------- Original Message -------- On 8/21/24 6:24 AM, DetachHead wrote:
hmm, nothing helpful there. the only noteworthy thing i can see is this from the first log you posted:
Error: Unhandled method client/registerCapability at handleResponse (c:\Users\nguye.vscode-oss\extensions\detachhead.basedpyright-1.16.0-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:561:48) at handleMessage (c:\Users\nguye.vscode-oss\extensions\detachhead.basedpyright-1.16.0-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:398:20) at Immediate.
(c:\Users\nguye.vscode-oss\extensions\detachhead.basedpyright-1.16.0-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:368:30) at processImmediate (node:internal/timers:478:21) i have no idea what could be causing it. though. does the issue persist if you uninstall and reinstall the extension?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
can you set basedpyright.analysis.logLevel
to "Trace" in the extension settings, restart vscode and see if that makes anything more show up in the logs?
Sorry for taking a while to get back to you, I was away from my computer for a while. This is what I got when I set the extension log level to "Trace":
[Info - 7:26:19 PM] basedpyright language server 1.17.1 starting
[Info - 7:26:19 PM] Server root directory: file:///c%3A/Users/nguye/.vscode-oss/extensions/detachhead.basedpyright-1.17.1-universal/dist
[Info - 7:26:19 PM] Registering request handler for workspace/didChangeWatchedFiles failed.
Error: Unhandled method client/registerCapability
at handleResponse (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:561:48)
at handleMessage (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:398:20)
at Immediate.<anonymous> (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:368:30)
at processImmediate (node:internal/timers:478:21)
[Error - 7:26:19 PM] Server process exited with code 1.
[Info - 7:26:19 PM] Connection to server got closed. Server will restart.
true
[Info - 7:26:19 PM] basedpyright language server 1.17.1 starting
[Info - 7:26:19 PM] Server root directory: file:///c%3A/Users/nguye/.vscode-oss/extensions/detachhead.basedpyright-1.17.1-universal/dist
[Info - 7:26:19 PM] Registering request handler for workspace/didChangeWatchedFiles failed.
Error: Unhandled method client/registerCapability
at handleResponse (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:561:48)
at handleMessage (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:398:20)
at Immediate.<anonymous> (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:368:30)
at processImmediate (node:internal/timers:478:21)
[Error - 7:26:20 PM] Server process exited with code 1.
[Info - 7:26:20 PM] Connection to server got closed. Server will restart.
true
[Info - 7:26:20 PM] basedpyright language server 1.17.1 starting
[Info - 7:26:20 PM] Server root directory: file:///c%3A/Users/nguye/.vscode-oss/extensions/detachhead.basedpyright-1.17.1-universal/dist
[Info - 7:26:20 PM] Registering request handler for workspace/didChangeWatchedFiles failed.
Error: Unhandled method client/registerCapability
at handleResponse (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:561:48)
at handleMessage (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:398:20)
at Immediate.<anonymous> (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:368:30)
at processImmediate (node:internal/timers:478:21)
[Error - 7:26:21 PM] Server process exited with code 1.
[Info - 7:26:21 PM] Connection to server got closed. Server will restart.
true
[Info - 7:26:21 PM] basedpyright language server 1.17.1 starting
[Info - 7:26:21 PM] Server root directory: file:///c%3A/Users/nguye/.vscode-oss/extensions/detachhead.basedpyright-1.17.1-universal/dist
[Info - 7:26:21 PM] Registering request handler for workspace/didChangeWatchedFiles failed.
Error: Unhandled method client/registerCapability
at handleResponse (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:561:48)
at handleMessage (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:398:20)
at Immediate.<anonymous> (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:368:30)
at processImmediate (node:internal/timers:478:21)
[Error - 7:26:21 PM] Server process exited with code 1.
[Info - 7:26:21 PM] Connection to server got closed. Server will restart.
true
[Info - 7:26:21 PM] basedpyright language server 1.17.1 starting
[Info - 7:26:21 PM] Server root directory: file:///c%3A/Users/nguye/.vscode-oss/extensions/detachhead.basedpyright-1.17.1-universal/dist
[Info - 7:26:21 PM] Registering request handler for workspace/didChangeWatchedFiles failed.
Error: Unhandled method client/registerCapability
at handleResponse (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:561:48)
at handleMessage (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:398:20)
at Immediate.<anonymous> (c:\Users\nguye\.vscode-oss\extensions\detachhead.basedpyright-1.17.1-universal\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:368:30)
at processImmediate (node:internal/timers:478:21)
[Error - 7:26:22 PM] Server process exited with code 1.
[Error - 7:26:22 PM] The basedpyright server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
are you able to see if it works in vscode instead of vscodium? for me it works in both but just trying to narrow down the issue as i have no clue what could be going on here
maybe also list any other extensions you have installed
Yeah it works in my VSCode installation. And oddly enough, when I did a fresh install of VSCodium and transferred my old extensions/settings to this installation, the BasedPyright extension worked. I'm not sure what was wrong with my previous VSCodium installation, but a fresh install seemed to fix whatever issue that was.
Anyway thank you for your help, and I'll let you know if I run into any new issues.
i'll assume your vscodium installation was corrupted or something and close this issue. let us know if it happens again and we can reopen it
I would like to re-open this topic because I have the same problem with the modern versions of BasedPyright. Here is some information on its execution context:
"basedpyright.analysis.logLevel": "Trace"
- Working version (1.15.1):"basedpyright.analysis.logLevel": "Trace"
- Unworking version (1.15.2):"basedpyright.analysis.logLevel": "Trace"
- Unworking version (latest):If you need more information or tests, let me know. For the moment, I will use version 1.15.1 because I need the extension.
does reinstalling vscodium fix the issue for you like it did for @bdknguyen?
pretty sure i know what the issue is, fix will be in the next release
does reinstalling vscodium fix the issue for you like it did for @bdknguyen? v pouviezus
I forgot to specify it in my message but I of course tested the complete reinstallation and no, it doesn't change anything.
pretty sure i know what the issue is, fix will be in the next release
I don't know how to compile an extension so I can't test it alone. If you could send me the update of #637 in .VSIX I could be your beta tester; otherwise, I will wait for the official update to tell you if it reworks.
you can download the .vsix
from the CI artifacts, thanks
you can download the
.vsix
from the CI artifacts, thanks
Ok, my bad 😅 Otherwise... bad news:
New information: if I open a Folder/Workspace, it's working.
I tested with the latest version (1.17.1) and it also works but as for version 1.1.378, it only works if you are in a Folder/Workspace.
One more thing: it appears that version 1.1.378 attempts to access a default workspace when no folders or workspaces are open in the IDE. However, since it is trying to access a non-existent location, it cannot work which would cause the malfunction.
[Info - 14:03:47] Adding fs watcher for directories: file:///%3Cdefault%20workspace%20root%3E Searching for source files [Error - 14:03:47] File or directory "
" does not exist. [Info - 14:03:47] No source files found.
He therefore tries to access this location: file:///<default workspace root>
I don't know if it's the same problem for version 1.15.2 and above but it seems likely to me.
that's a different issue that seems to have come from upstream. we previously thought it was specific to neovim but i guess not. will raise a separate issue for that
OS:
Windows 11
Editor:VSCodium 1.92.2
Installed pypi package using pip within conda environmentI recently installed the BasedPyright VSCode extension (v1.16.0), but it fails to load because the language server keeps crashing on startup.
Here are the error messages I'm getting:
And here is the output log: