[gnome-builder/wip/chergert/lsp-plugin-loader] libide/lsp: register languages from .plugin



commit c19710777ef2ceee44b50daf6be8845a57a749bd
Author: Christian Hergert <chergert redhat com>
Date:   Thu Oct 13 21:27:57 2022 -0500

    libide/lsp: register languages from .plugin

 src/libide/lsp/ide-lsp-plugin.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/libide/lsp/ide-lsp-plugin.c b/src/libide/lsp/ide-lsp-plugin.c
index 3d38f39c7..1d6bedc40 100644
--- a/src/libide/lsp/ide-lsp-plugin.c
+++ b/src/libide/lsp/ide-lsp-plugin.c
@@ -101,8 +101,8 @@ typedef struct _IdeLspPluginService
 
 typedef struct _IdeLspPluginServiceClass
 {
-  IdeLspServiceClass parent_class;
-  IdeLspPluginInfo *info;
+  IdeLspServiceClass  parent_class;
+  IdeLspPluginInfo   *info;
 } IdeLspPluginServiceClass;
 
 static void
@@ -110,13 +110,19 @@ ide_lsp_plugin_service_configure_client (IdeLspService *service,
                                          IdeLspClient  *client)
 {
   IdeLspPluginService *self = (IdeLspPluginService *)service;
-  //IdeLspPluginServiceClass *klass = (IdeLspPluginServiceClass *)((GTypeInstance *)service)->g_class;
+  IdeLspPluginServiceClass *klass = (IdeLspPluginServiceClass *)((GTypeInstance *)service)->g_class;
   g_autoptr(GVariant) options = NULL;
   IdeContext *context;
 
   g_assert (IDE_IS_LSP_SERVICE (self));
   g_assert (IDE_IS_LSP_CLIENT (client));
 
+  if (klass->info->languages != NULL)
+    {
+      for (guint i = 0; klass->info->languages[i]; i++)
+        ide_lsp_client_add_language (client, klass->info->languages[i]);
+    }
+
   if (!(context = ide_object_get_context (IDE_OBJECT (service))))
     return;
 


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