[gnome-builder] lsp: implement introspection contract



commit c9d9f6500976204fb70c765fb918a801af2ec137
Author: Christian Hergert <chergert redhat com>
Date:   Thu Aug 19 15:00:13 2021 -0700

    lsp: implement introspection contract
    
    Full transfer means we do not provide the clear func on the array itself.

 src/libide/lsp/ide-lsp-completion-item.c     | 8 ++++----
 src/libide/lsp/ide-lsp-completion-provider.c | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/libide/lsp/ide-lsp-completion-item.c b/src/libide/lsp/ide-lsp-completion-item.c
index 63a07abe4..f51741d8d 100644
--- a/src/libide/lsp/ide-lsp-completion-item.c
+++ b/src/libide/lsp/ide-lsp-completion-item.c
@@ -193,11 +193,11 @@ ide_lsp_completion_item_get_snippet (IdeLspCompletionItem *self)
  *
  * Returns: (transfer full) (element-type IdeTextEdit) (nullable): a #GPtrArray of #IdeTextEdit
  *
- * Since: 41
+ * Since: 41.0
  */
 GPtrArray *
-ide_lsp_completion_item_get_additional_text_edits(IdeLspCompletionItem *self,
-                                                  GFile                *file)
+ide_lsp_completion_item_get_additional_text_edits (IdeLspCompletionItem *self,
+                                                   GFile                *file)
 {
   g_autoptr(GPtrArray) result = NULL;
   g_autoptr(GVariantIter) text_edit_iter = NULL;
@@ -225,5 +225,5 @@ ide_lsp_completion_item_get_additional_text_edits(IdeLspCompletionItem *self,
 #endif
     }
 
-  return g_steal_pointer (&result);
+  return IDE_PTR_ARRAY_STEAL_FULL (&result);
 }
diff --git a/src/libide/lsp/ide-lsp-completion-provider.c b/src/libide/lsp/ide-lsp-completion-provider.c
index c908000b7..2b92a3818 100644
--- a/src/libide/lsp/ide-lsp-completion-provider.c
+++ b/src/libide/lsp/ide-lsp-completion-provider.c
@@ -412,7 +412,6 @@ ide_lsp_completion_provider_activate_proposal (IdeCompletionProvider *provider,
   GtkTextBuffer *buffer;
   GtkTextView *view;
   GtkTextIter begin, end;
-  IdeContext *context;
   g_autoptr(GPtrArray) additional_text_edits;
   IdeBufferManager *buffer_manager;
 
@@ -437,10 +436,11 @@ ide_lsp_completion_provider_activate_proposal (IdeCompletionProvider *provider,
   additional_text_edits =
     ide_lsp_completion_item_get_additional_text_edits (IDE_LSP_COMPLETION_ITEM (proposal),
                                                        ide_buffer_get_file (IDE_BUFFER (buffer)));
+  IDE_PTR_ARRAY_SET_FREE_FUNC (additional_text_edits, g_object_unref);
 
   if (additional_text_edits != NULL)
     {
-      context = ide_object_get_context (IDE_OBJECT (provider));
+      IdeContext *context = ide_object_get_context (IDE_OBJECT (provider));
 
       g_return_if_fail (context != NULL);
 


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