-
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
Needs more documentation for end-users on where to define node_bin #53
Comments
People don't explicitly install lsp_utils but just get it by proxy. So I'm not sure what would be a good place to educate the user. Technically the user doesn't really need to customize it. Initially I wasn't even planning on having a setting for it. Only that it serves the purpose of helping the user if his PATH is not setup properly. |
I suppose the solution to this is to just add a comment line like https://github.com/sublimelsp/LSP-json/blob/c99d736ff165e734e32ca7a07e0aac2b58c66cbd/LSP-json.sublime-settings#L2 to all packages that use "node_bin". |
I thought the Node.js path finding mechanism was a little bit obscured, especially when you were not using the system-provided Node binary or npm script. I gave up at the end and read the source code to figure out what happened. Ended up adding my own hack in the |
Looks like you don't want to use Node from the PATH then and instead manually hardcode the path to Node in the |
Actually I'm not sure how would that work in your case. Also not sure what sort of solution would you see for that case. Everything really relies on node being in the PATH if you are not using bundled Node. |
Sorry for lack of clarity. Considering that Sublime Text is a GUI application, I think it is common for users within a desktop environment to launch it from their desktop e.g., application menu, instead of from the terminal. The way of configuring a PATH variable for an application is DE-dependent and generally not straightforward. The complexity is compounded in the case of On the other hand, opting for a bundled Node "just works", but it means that a Node environment is duplicated, extra installation time involves, and one need to store all those language-server dependencies in some cache directory. In my assessment on average use cases, that should be considered the last resort. As a result, I prefer that there is yet another way to specify the path to node/npm, even if it requires hardcoding them in the config. |
If you intention is to use a single local node instance within whole of ST then you should be able to do that by exposing it in PATH. Here is how it should be configured on a system-basis - https://lsp.sublimetext.io/troubleshooting/#updating-the-path-used-by-lsp-servers If you want to use different node instance per project then that's not really compatible with PATH approach as that is global for the whole application. So is your intention to be able to configure node instance per-project? |
When you add it to the // Settings in here override those in "LSP-typescript/LSP-typescript.sublime-settings"
{
"initializationOptions": {
"disableAutomaticTypingAcquisition": true,
"locale": "zh-TW",
},
"enabled": true,
"env": {
"PATH": "/Users/qbane/.volta/bin:$PATH"
}
} |
But my question was (out of curiosity, not promising anything) what would be a satisfactory solution for you.
|
Well... I think a global setting is sufficient for me. Different type of language servers or projects may depend on different version of packages, but they can check and apply their own config after starting up. |
A lot of npm-based packages have a ${node_bin} variable now but it's not clear to me how to customize that.
The text was updated successfully, but these errors were encountered: