-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add local node runtime to the PATH when starting the server #64
Comments
So this would be an absolute hack: --- a/plugin/core/types.py
+++ b/plugin/core/types.py
@@ -663,7 +663,10 @@ class ClientConfig:
command = [a.replace('{port}', str(tcp_port)) for a in command]
env = os.environ.copy()
for var, value in self.env.items():
- env[var] = sublime.expand_variables(value, variables)
+ if var == "extra_paths":
+ env["PATH"] += os.path.pathsep + os.path.pathsep.join(value)
+ else:
+ env[var] = sublime.expand_variables(value, variables)
return TransportConfig(self.name, command, tcp_port, env, listener_socket) The proper solution would be to extend |
can't you just modify the env of the ClientConfig in |
why wouldn't this work
|
The code that creates the transport overrides the whole PATH with what user defined in
Sure but that would modify ST's environment. |
Is this now possible? I’m having similar problem when using TypeScript server described here: sublimelsp/LSP#1671 (comment) Am I doing everything right? I even tried setting |
You seem to be confused on multiple levels :) Just check and follow https://lsp.sublimetext.io/troubleshooting/#2-lsp-cannot-find-my-language-server-no-such-file-or-directory-xyz |
When using a local node runtime, some servers (LSP-typescript) expect to find
node
on thePATH
so that they can start a node sub-process.We should add our local node to the
PATH
.The
PATH
can be extended usingenv
object in the settings but that's not ideal as that overrides the originalPATH
. Also, this should be done in a generic way for all node-based servers.The relevant code is at https://github.com/sublimelsp/LSP/blob/main/plugin/core/types.py#L663-L664 but I don't have immediate idea how to fix that in a nice way. By nice I mean so that:
PATH
instead of replacing wholePATH
env.PATH
without breaking thatThe text was updated successfully, but these errors were encountered: