[gnome-builder] rust-langserv: run the rls binary from within project dir



commit da0c0cb3daf571cc646df0ed36d65559a5d78910
Author: Christian Hergert <chergert redhat com>
Date:   Sat Mar 18 03:46:06 2017 -0700

    rust-langserv: run the rls binary from within project dir
    
    We want to make sure that relative paths can be loaded, so it's probably
    just safer to run this from within the project directory.

 plugins/rust-langserv/rust_langserv_plugin.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/plugins/rust-langserv/rust_langserv_plugin.py b/plugins/rust-langserv/rust_langserv_plugin.py
index df9d66d..49cbb05 100644
--- a/plugins/rust-langserv/rust_langserv_plugin.py
+++ b/plugins/rust-langserv/rust_langserv_plugin.py
@@ -82,6 +82,10 @@ class RustService(Ide.Object, Ide.Service):
                 launcher.setenv("SYS_ROOT", sysroot, True)
                 launcher.setenv("LD_LIBRARY_PATH", os.path.join(sysroot, "lib"), True)
 
+            # Locate the directory of the project and run rls from there.
+            workdir = self.get_context().get_vcs().get_working_directory()
+            launcher.set_cwd(workdir.get_path())
+
             # If rls was installed with Cargo, try to discover that
             # to save the user having to update PATH.
             path_to_rls = os.path.expanduser("~/.cargo/bin/rls")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]