Closed yecloud closed 1 year ago
You use unix version . Try to see what Terminal shows when you run this command by hands:
"/usr/local/bin/pyright-langserver --stdio”
lip_pyright.json
must be lsp_*.json
, not lip
.
is it working when you run it from terminal?
add "log_stderr": true,
and try again.
You use unix version . Try to see what Terminal shows when you run this command by hands:
"/usr/local/bin/pyright-langserver --stdio”
iMac27:~ zachary$ /usr/local/bin/pyright-langserver --stdio
Content-Length: 119
{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Pyright language server 1.1.313 starting"}}Content-Length: 174
{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Server root directory: /usr/local/Cellar/pyright/1.1.313/libexec/lib/node_modules/pyright/dist/"}}
lip_pyright.json
must be
lsp_*.json
, notlip
.is it working when you run it from terminal? add
"log_stderr": true,
and try again.
env: node: No such file or directory
How to setup node path?
how did you install node? why it's not in Path?
how did you install node? why it's not in Path?
I installed node from homebrew. It's in PATH and I can call it from terminal. Why can't LSP find it? And I can call node in terminal+ It seems LSP does not load the system PATH
i had problem with nodeenv certificate on my virtual macos machine. fixed it and pyright works ok now.
@yecloud , what output do you have after you call this command: nodeenv env
?
if certificate error, try to fix it with the following command: /Applications/Python\ 3.10/Install\ Certificates.command
BTW, pyright will install node inside it's own nodeenv folder.
# you can also try to delete `/Users/yura/.cache/pyright-python/...` dir and try again.
BTW, pyright will install node inside it's own nodeenv folder.
# you can also try to delete `/Users/yura/.cache/pyright-python/...` dir and try again.
I fixed the certificate and nothing changed. I guess I should install pyright through pip instead of the homebrew one, will try. ----------------> Yes, I should use the pip pyright instead of the homebrew one. It's now working. I think this should be mentioned in Wiki.
The LSP is working now, but how to make it work with virtualenv?
And the question could be: how to send a config file to LSP server? I have the similar issue in rust-analyzer since linkedProjects
is required.
in Command Palette type "readme", then Enter, then select "LSP client". readme file will be opened, scroll to "Server-specific options" section.
you can send settings globally or per project.
maybe better variant will be to create "pyrightconfig.json" file or "pyproject.toml" file. read here: https://github.com/microsoft/pyright/blob/main/docs/configuration.md
I added @veksha 's suggestion to https://wiki.freepascal.org/CudaText_plugins#LSP_server_for_Python.2C_pyright
I have the similar issue in rust-analyzer since linkedProjects is required.
Let’s post rust-analyser question to a new topic. But I fear @veksha don’t use Rust and he don’t know. Closing this issue.
I have followed the steps in the wiki, and the console said: LSP: starting server - Python; root: /Users/zachary/fxenon/crm But the LSP console displays nothing, and no LSP function work (hover, type definition, etc). here is the lsp_pyright.json