RLS runs with the home directory as the CWD, breaking RLS wrappers #448
Description
When RLS is started by this plugin, it's run with the home directory as the current working directory, as opposed to the crate root. This breaks wrapper scripts that rely on project-specific information to run RLS in a particular environment or with a particular configuration.
For example, this is what I use for running RLS in the context of a Nix shell (essentially a self-contained environment with all the project dependencies present), under ide-rust
in Atom:
if [ -e shell.nix ]
then
nix-shell --run "rls $@"
else
rls $@
fi
That script is then configured as the RLS path, and that will result in RLS being run within the correct environment. The same script does not work with this plugin, since the current working directory is always /home/sven
for me no matter the project, and therefore the build gets executed in the wrong environment (and subsequently fails).
Changing this to always pick the crate root as the cwd would resolve this issue, and I don't think it would break anything else. I'd also argue that it'd make more sense semantically, since that's how one would run it from a shell.