[gnome-builder] rust-langserv: shutdown rls process upon IdeService::stop()



commit e44f22a9e3ec12c7b0b4f46637d75bd62cbe62bf
Author: Christian Hergert <chergert redhat com>
Date:   Sat Oct 29 15:05:02 2016 -0700

    rust-langserv: shutdown rls process upon IdeService::stop()

 plugins/rust-langserv/rust_langserv_plugin.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/plugins/rust-langserv/rust_langserv_plugin.py b/plugins/rust-langserv/rust_langserv_plugin.py
index 6144332..636e402 100644
--- a/plugins/rust-langserv/rust_langserv_plugin.py
+++ b/plugins/rust-langserv/rust_langserv_plugin.py
@@ -38,6 +38,7 @@ from gi.repository import Ide
 class RustService(Ide.Object, Ide.Service):
     _client = None
     _has_started = False
+    _supervisor = None
 
     @GObject.Property(type=Ide.LangservClient)
     def client(self):
@@ -48,6 +49,15 @@ class RustService(Ide.Object, Ide.Service):
         self._client = value
         self.notify('client')
 
+    def do_stop(self):
+        """
+        Stops the Rust Language Server upon request to shutdown the
+        RustService.
+        """
+        if self._supervisor:
+            supervisor, self._supervisor = self._supervisor, None
+            supervisor.stop()
+
     def _ensure_started(self):
         """
         Start the rust service which provides communication with the


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