[gnome-builder/1074-vala-language-server-add-support-using-gvls: 21/23] GVls: initial work for Vala Server configuration response
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/1074-vala-language-server-add-support-using-gvls: 21/23] GVls: initial work for Vala Server configuration response
- Date: Tue, 10 Dec 2019 14:20:43 +0000 (UTC)
commit 4804520a5b12adf77e61c83ca1f61a0269e0b6eb
Author: Daniel Espinosa Ortiz <esodan gmail com>
Date: Thu Dec 5 08:57:33 2019 -0600
GVls: initial work for Vala Server configuration response
src/plugins/gvls/gvls_plugin.py | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
---
diff --git a/src/plugins/gvls/gvls_plugin.py b/src/plugins/gvls/gvls_plugin.py
index 8cc06fb63..9ba613df0 100644
--- a/src/plugins/gvls/gvls_plugin.py
+++ b/src/plugins/gvls/gvls_plugin.py
@@ -116,6 +116,37 @@ class GVlsService(Ide.Object):
self._supervisor.set_launcher(launcher)
self._supervisor.start()
+ ## Construct GVls Configuration response at `initialize`
+ self._client.connect('load-configuration', _on_load_configuration)
+
+ def _on_load_configuration(self):
+ conf = GLib.VariantBuilder (GLib.Variant ('a{sv}'))
+ conf.add ('{sv}', 'initialized', GLib.Variant.boolean (True))
+ conf.add ('{sv}', 'initialized', GLib.Variant.boolean (True))
+ conf.add ('{sv}', 'defaultNamespaces', GLib.Variant.boolean (True))
+ conf.add ('{sv}', 'defaultVapiDirs', GLib.Variant.boolean (True))
+ conf.add ('{sv}', 'scanWorkspace', GLib.Variant.boolean (True))
+ conf.add ('{sv}', 'addUsingNamespaces', GLib.Variant.boolean (True))
+
+ pkgs = GLib.VariantBuilder (GLib.Variant ('av'))
+ # Get from build environment
+ # pkgs.add ('v', GLib.Variant.string ())
+
+ vargs = GLib.VariantBuilder (GLib.Variant ('av'))
+ # Get from build environment
+ # vargs.add ('v', GLib.Variant.string ())
+
+ opts = GLib.VariantBuilder (GLib.Variant ('av'))
+ # Get from build environment
+ # vargs.add ('v', GLib.Variant.string ())
+
+ conf.add ('{sv}', 'packages', pkgs)
+ conf.add ('{sv}', 'valaArgs', vargs)
+ conf.add ('{sv}', 'options', opts)
+
+ conf.end ()
+ return conf
+
def _gvls_spawned(self, supervisor, subprocess):
"""
This callback is executed when the `org.gnome.gvls.stdio.Server` process is spawned.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]