[gnome-builder] libide-lsp: remove various libdazzle usage



commit 6a31c63c34380439882f7aa963d0ef1553f2df13
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jul 11 17:57:28 2022 -0700

    libide-lsp: remove various libdazzle usage
    
    And fix up availability macros

 src/libide/lsp/ide-lsp-client.c              | 46 ++++++++++------------------
 src/libide/lsp/ide-lsp-diagnostic-provider.c | 10 +++---
 src/libide/lsp/ide-lsp-diagnostic.c          |  2 --
 src/libide/lsp/ide-lsp-highlighter.c         | 13 ++++----
 4 files changed, 28 insertions(+), 43 deletions(-)
---
diff --git a/src/libide/lsp/ide-lsp-client.c b/src/libide/lsp/ide-lsp-client.c
index ab72d3493..8ee205b77 100644
--- a/src/libide/lsp/ide-lsp-client.c
+++ b/src/libide/lsp/ide-lsp-client.c
@@ -22,15 +22,13 @@
 
 #include "config.h"
 
-#include <dazzle.h>
-#include <dazzle.h>
 #include <glib/gi18n.h>
 #include <jsonrpc-glib.h>
+#include <unistd.h>
+
 #include <libide-code.h>
 #include <libide-projects.h>
-#include <libide-sourceview.h>
 #include <libide-threading.h>
-#include <unistd.h>
 
 #include "ide-lsp-client.h"
 #include "ide-lsp-diagnostic.h"
@@ -54,8 +52,8 @@ typedef struct
 
 typedef struct
 {
-  DzlSignalGroup *buffer_manager_signals;
-  DzlSignalGroup *project_signals;
+  IdeSignalGroup *buffer_manager_signals;
+  IdeSignalGroup *project_signals;
   JsonrpcClient  *rpc_client;
   GIOStream      *io_stream;
   GHashTable     *diagnostics_by_file;
@@ -560,14 +558,14 @@ ide_lsp_client_buffer_unloaded (IdeLspClient     *self,
 static void
 ide_lsp_client_buffer_manager_bind (IdeLspClient     *self,
                                     IdeBufferManager *buffer_manager,
-                                    DzlSignalGroup   *signal_group)
+                                    IdeSignalGroup   *signal_group)
 {
   guint n_items;
 
   g_assert (IDE_IS_MAIN_THREAD ());
   g_assert (IDE_IS_LSP_CLIENT (self));
   g_assert (IDE_IS_BUFFER_MANAGER (buffer_manager));
-  g_assert (DZL_IS_SIGNAL_GROUP (signal_group));
+  g_assert (IDE_IS_SIGNAL_GROUP (signal_group));
 
   n_items = g_list_model_get_n_items (G_LIST_MODEL (buffer_manager));
 
@@ -582,10 +580,10 @@ ide_lsp_client_buffer_manager_bind (IdeLspClient     *self,
 
 static void
 ide_lsp_client_buffer_manager_unbind (IdeLspClient   *self,
-                                      DzlSignalGroup *signal_group)
+                                      IdeSignalGroup *signal_group)
 {
   g_assert (IDE_IS_LSP_CLIENT (self));
-  g_assert (DZL_IS_SIGNAL_GROUP (signal_group));
+  g_assert (IDE_IS_SIGNAL_GROUP (signal_group));
 
   /* TODO: We need to track everything we've notified so that we
    *       can notify the peer to release its resources.
@@ -1329,8 +1327,6 @@ ide_lsp_client_class_init (IdeLspClientClass *klass)
    *
    * Returns: (transfer full): a #GVariant containing the result or %NULL
    *   to proceed to the next signal handler.
-   *
-   * Since: 3.36
    */
   signals [LOAD_CONFIGURATION] =
     g_signal_new ("load-configuration",
@@ -1392,19 +1388,19 @@ ide_lsp_client_init (IdeLspClient *self)
                                                      g_object_unref,
                                                      (GDestroyNotify)g_object_unref);
 
-  priv->buffer_manager_signals = dzl_signal_group_new (IDE_TYPE_BUFFER_MANAGER);
+  priv->buffer_manager_signals = ide_signal_group_new (IDE_TYPE_BUFFER_MANAGER);
 
-  dzl_signal_group_connect_object (priv->buffer_manager_signals,
+  ide_signal_group_connect_object (priv->buffer_manager_signals,
                                    "buffer-loaded",
                                    G_CALLBACK (ide_lsp_client_buffer_loaded),
                                    self,
                                    G_CONNECT_SWAPPED);
-  dzl_signal_group_connect_object (priv->buffer_manager_signals,
+  ide_signal_group_connect_object (priv->buffer_manager_signals,
                                    "buffer-saved",
                                    G_CALLBACK (ide_lsp_client_buffer_saved),
                                    self,
                                    G_CONNECT_SWAPPED);
-  dzl_signal_group_connect_object (priv->buffer_manager_signals,
+  ide_signal_group_connect_object (priv->buffer_manager_signals,
                                    "buffer-unloaded",
                                    G_CALLBACK (ide_lsp_client_buffer_unloaded),
                                    self,
@@ -1421,14 +1417,14 @@ ide_lsp_client_init (IdeLspClient *self)
                            self,
                            G_CONNECT_SWAPPED);
 
-  priv->project_signals = dzl_signal_group_new (IDE_TYPE_PROJECT);
+  priv->project_signals = ide_signal_group_new (IDE_TYPE_PROJECT);
 
-  dzl_signal_group_connect_object (priv->project_signals,
+  ide_signal_group_connect_object (priv->project_signals,
                                    "file-trashed",
                                    G_CALLBACK (ide_lsp_client_project_file_trashed),
                                    self,
                                    G_CONNECT_SWAPPED);
-  dzl_signal_group_connect_object (priv->project_signals,
+  ide_signal_group_connect_object (priv->project_signals,
                                    "file-renamed",
                                    G_CALLBACK (ide_lsp_client_project_file_renamed),
                                    self,
@@ -1487,10 +1483,10 @@ ide_lsp_client_initialized_cb (GObject      *object,
 
   context = ide_object_get_context (IDE_OBJECT (self));
   buffer_manager = ide_buffer_manager_from_context (context);
-  dzl_signal_group_set_target (priv->buffer_manager_signals, buffer_manager);
+  ide_signal_group_set_target (priv->buffer_manager_signals, buffer_manager);
 
   project = ide_project_from_context (context);
-  dzl_signal_group_set_target (priv->project_signals, project);
+  ide_signal_group_set_target (priv->project_signals, project);
 
   priv->initialized = TRUE;
 
@@ -1908,8 +1904,6 @@ ide_lsp_client_queue_message (IdeLspClient *self,
  * Asynchronously queries the Language Server using the JSON-RPC protocol.
  *
  * If @params is floating, it's floating reference is consumed.
- *
- * Since: 3.26
  */
 void
 ide_lsp_client_call_async (IdeLspClient        *self,
@@ -2016,8 +2010,6 @@ ide_lsp_client_send_notification_cb (GObject      *object,
  * Asynchronously sends a notification to the Language Server.
  *
  * If @params is floating, it's reference is consumed.
- *
- * Since: 3.26
  */
 void
 ide_lsp_client_send_notification_async (IdeLspClient        *self,
@@ -2213,8 +2205,6 @@ ide_lsp_client_set_root_uri (IdeLspClient *self,
  *
  * Returns: (transfer none) (nullable): a #GVariant that is a
  *   %G_VARIANT_TYPE_VARDICT or %NULL.
- *
- * Since: 3.36
  */
 GVariant *
 ide_lsp_client_get_server_capabilities (IdeLspClient *self)
@@ -2237,8 +2227,6 @@ ide_lsp_client_get_server_capabilities (IdeLspClient *self)
  * if @options is floating, the floating reference will be taken
  * when calling this function otherwise the reference count of
  * @options will be incremented by one.
- *
- * Since: 42.0
  */
 void
 ide_lsp_client_set_initialization_options (IdeLspClient *self,
diff --git a/src/libide/lsp/ide-lsp-diagnostic-provider.c b/src/libide/lsp/ide-lsp-diagnostic-provider.c
index 190d53553..245d6f542 100644
--- a/src/libide/lsp/ide-lsp-diagnostic-provider.c
+++ b/src/libide/lsp/ide-lsp-diagnostic-provider.c
@@ -22,8 +22,8 @@
 
 #include "config.h"
 
-#include <dazzle.h>
 #include <json-glib/json-glib.h>
+
 #include <libide-code.h>
 #include <libide-threading.h>
 
@@ -32,7 +32,7 @@
 typedef struct
 {
   IdeLspClient *client;
-  DzlSignalGroup    *client_signals;
+  IdeSignalGroup    *client_signals;
 } IdeLspDiagnosticProviderPrivate;
 
 static void diagnostic_provider_iface_init (IdeDiagnosticProviderInterface *iface);
@@ -209,9 +209,9 @@ ide_lsp_diagnostic_provider_init (IdeLspDiagnosticProvider *self)
 {
   IdeLspDiagnosticProviderPrivate *priv = ide_lsp_diagnostic_provider_get_instance_private (self);
 
-  priv->client_signals = dzl_signal_group_new (IDE_TYPE_LSP_CLIENT);
+  priv->client_signals = ide_signal_group_new (IDE_TYPE_LSP_CLIENT);
 
-  dzl_signal_group_connect_object (priv->client_signals,
+  ide_signal_group_connect_object (priv->client_signals,
                                    "published-diagnostics",
                                    G_CALLBACK (ide_diagnostic_provider_emit_invalidated),
                                    self,
@@ -246,7 +246,7 @@ ide_lsp_diagnostic_provider_set_client (IdeLspDiagnosticProvider *self,
 
   if (g_set_object (&priv->client, client))
     {
-      dzl_signal_group_set_target (priv->client_signals, client);
+      ide_signal_group_set_target (priv->client_signals, client);
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_CLIENT]);
     }
 }
diff --git a/src/libide/lsp/ide-lsp-diagnostic.c b/src/libide/lsp/ide-lsp-diagnostic.c
index f632d2858..74036abf3 100644
--- a/src/libide/lsp/ide-lsp-diagnostic.c
+++ b/src/libide/lsp/ide-lsp-diagnostic.c
@@ -138,8 +138,6 @@ ide_lsp_diagnostic_init (IdeLspDiagnostic *self)
  * returns it.
  *
  * Returns: (transfer full) (nullable): a #GVariant with it's reference count incremented
- *
- * Since: 42.0
  */
 GVariant *
 ide_lsp_diagnostic_dup_raw (IdeLspDiagnostic *self)
diff --git a/src/libide/lsp/ide-lsp-highlighter.c b/src/libide/lsp/ide-lsp-highlighter.c
index 282210296..962cdce23 100644
--- a/src/libide/lsp/ide-lsp-highlighter.c
+++ b/src/libide/lsp/ide-lsp-highlighter.c
@@ -22,7 +22,6 @@
 
 #include "config.h"
 
-#include <dazzle.h>
 #include <libide-code.h>
 #include <jsonrpc-glib.h>
 
@@ -44,7 +43,7 @@ typedef struct
 
   IdeLspClient       *client;
   IdeHighlightIndex  *index;
-  DzlSignalGroup     *buffer_signals;
+  IdeSignalGroup     *buffer_signals;
 
   const gchar        *style_map[IDE_SYMBOL_KIND_LAST];
 
@@ -282,7 +281,7 @@ ide_lsp_highlighter_dispose (GObject *object)
 
   priv->engine = NULL;
 
-  dzl_clear_source (&priv->queued_update);
+  g_clear_handle_id (&priv->queued_update, g_source_remove);
 
   g_clear_pointer (&priv->index, ide_highlight_index_unref);
   g_clear_object (&priv->buffer_signals);
@@ -353,7 +352,7 @@ ide_lsp_highlighter_init (IdeLspHighlighter *self)
 {
   IdeLspHighlighterPrivate *priv = ide_lsp_highlighter_get_instance_private (self);
 
-  priv->buffer_signals = dzl_signal_group_new (IDE_TYPE_BUFFER);
+  priv->buffer_signals = ide_signal_group_new (IDE_TYPE_BUFFER);
 
   /*
    * We sort of cheat here by using ::line-flags-changed instead of :;changed
@@ -363,7 +362,7 @@ ide_lsp_highlighter_init (IdeLspHighlighter *self)
    * where the language server gives us an empty set back (or at least with
    * the rust language server).
    */
-  dzl_signal_group_connect_object (priv->buffer_signals,
+  ide_signal_group_connect_object (priv->buffer_signals,
                                    "line-flags-changed",
                                    G_CALLBACK (ide_lsp_highlighter_buffer_line_flags_changed),
                                    self,
@@ -508,14 +507,14 @@ ide_lsp_highlighter_set_engine (IdeHighlighter     *highlighter,
 
   priv->engine = engine;
 
-  dzl_signal_group_set_target (priv->buffer_signals, NULL);
+  ide_signal_group_set_target (priv->buffer_signals, NULL);
 
   if (engine != NULL)
     {
       IdeBuffer *buffer;
 
       buffer = ide_highlight_engine_get_buffer (engine);
-      dzl_signal_group_set_target (priv->buffer_signals, buffer);
+      ide_signal_group_set_target (priv->buffer_signals, buffer);
       ide_lsp_highlighter_queue_update (self);
     }
 


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