Skip to content
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

gluon.language-server.path should search in ~/.cargo.bin/ by default #20

Open
lilyball opened this issue Jun 26, 2018 · 3 comments
Open

Comments

@lilyball
Copy link

When looking for gluon_language-server using the gluon.language-server.path variable, the extension should add ~/.cargo/bin/ to $PATH prior to searching for the command. This way no configuration will be necessary for anyone who runs cargo install gluon_language-server.

If you want to be smarter, you could reproduce Cargo's logic for determining where to install ($CARGO_INSTALL_ROOT, followed by the install.root cargo key, then $CARGO_HOME, and then finally $HOME/.cargo), but the simplistic approach of just adding ~/.cargo/bin would cover the default un-customized case (which is probably most people).

@Marwes
Copy link
Member

Marwes commented Jun 26, 2018

Is it common to not have ~/,cargo/bin added to $PATH already? I'd expect a lot of other programs to fail as well if it isn't. Could use https://github.com/brson/home to resolve the path easily however.

@lilyball
Copy link
Author

I'm running on macOS, so GUI apps like VSCode don't inherit environment variables defined in my shell profile (as they're not children of the shell). And of course ~/.cargo/bin isn't in the system-default PATH. So tools installed in ~/.cargo/bin are available to my shell in the terminal, but aren't available to GUI apps.

There is an undocumented way of modifying the PATH environment variable exposed to GUI apps, but almost nobody uses it, it's not remotely convenient to use, and IIRC it requires actually logging out of your user account in order to apply any changes (because it controls the environment variables of the parent process that spawns the GUI apps, which means you need to restart that parent process, which can only be done by logging out).

tl;dr: on macOS, GUI apps will always have a PATH of /usr/bin:/bin:/usr/sbin:/sbin and that's it.

@JameeKim
Copy link

I'm on Ubuntu 18.04LTS, and today I found out that the language server failed to start with the path set to gluon_language-server or ~/.cargo/bin/gluon_language-server. After setting it to /home/<username>/.cargo/bin/gluon_language-server did it work, although I'm seeing another error (probably bc I'm trying gluon for the first time) but still the server seems to be successfully started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants