nova-python / Python.novaextension

Python for Nova
MIT License
13 stars 1 forks source link

Failed to start or restart pyright #7

Closed command-tab closed 4 months ago

command-tab commented 5 months ago

Hello! The Pyright server doesn't seem to be starting when this extension attempts to invoke it at Nova launch, or when I select the Extensions → Python → Restart Pyright menu item. When I do that, this is immediately logged to the Nova Extension Console:

Pyright[17:23:22.288000] env: node: No such file or directory
Pyright[17:23:22.289000] The request was cancelled.
Pyright[17:23:22.289000] Pyright connection closed unexpectedly: The request was cancelled.

I have both node and pyright installed via Homebrew, and I can even run /opt/homebrew/bin/pyright-langserver --stdio manually without issue. Homebrew-installed binaries are in my $PATH (/opt/homebrew/bin is present), and Nova is set to "Automatically request environment from login shell" in the Tools settings. Other portions work, like the ruff checker — I see a few code suggestions in the editor UI as a result of it working, which is fantastic.

I am stumped as to why attempting to start or restart pyright via this extension mentions node in the logs. Is that Nova trying and failing to invoke node? I couldn't find any motion of node in this codebase.

Any suggestions or insights you might have would be appreciated. Thank you!

dcwatson commented 4 months ago

Sorry I'm just now following up on this - are you still having trouble? This extension does not use node directly, but pyright-langserver does. I'm not sure how it would be able to find that but not node, if you installed them from homebrew, since the pyright formula depends on node.

command-tab commented 4 months ago

Thanks for following up! I did get it working eventually. The secret was moving the contents of my .bashrc to .bash_profile. Apparently only the latter gets sourced when Nova uses a shell.