Unable to use pyright in PATH
lovetox opened this issue · comments
Hi,
When i install LSP-Pyright it always donwloads pyright into some cache and use that instead of the one in PATH
Node 18 is installed, Pyright ist installed, both in PATH, yet i cannot prevent the server from downloading pyright and using that.
I tried deleting
/home/lovetox/.cache/sublime-text/Package Storage/LSP-pyright/18.7.0/language-server/node_modules/pyright/dist/
but it did not help
Im on Ubuntu 22.10
One thing to try is overriding "command": ["${node_bin}", "${server_path}", "--stdio"],
in LSP-pyright's settings. So that you can use your own Node binary and server But I am not sure whether this will stop LSP-pyright downloading the server.
I probably not using the right terms.
Is the project https://github.com/microsoft/pyright the server? or does this project here provide the server?
What i want to achieve is that i can use the pyright version i want.
i installed node and pyright globally.
And i would like that sublime uses that global installation to type check the codebase.
how would i need to adjust "command" so that it uses the global installed pyright in PATH?
Is the project microsoft/pyright the server?
yes, it is.
or does this project here provide the server?
LSP-pyright downloads pyright and manage it for users.
how would i need to adjust "command" so that it uses the global installed pyright in PATH?
From LSP-pyright's settings. Adjust it to whatever command you want to use to start pyright.
"command": ["${node_bin}", "${server_path}", "--stdio"],
is the default. LSP-pyright replaces "${node_bin}"
to the Node.js bin path obtained from lsp_utils lib, and replaces "${server_path}"
to the server bin it manages. Now, since you don't want to use them, you have to replace them with yours like "command": ["/usr/bin/node", "/home/me/node_modules/pyright/langserver.index.js", "--stdio"],
.
Thanks, i close as this works for me.