[gtksourceview/wip/chergert/gsv-gtk4: 214/259] completion: fix various gir warnings




commit 9b1eaf790333832d94ce0779ee05509ba0a24b10
Author: Christian Hergert <chergert redhat com>
Date:   Sun Aug 30 19:59:40 2020 -0700

    completion: fix various gir warnings

 gtksourceview/gtksourcecompletion.c         |  1 -
 gtksourceview/gtksourcecompletioncontext.c  | 28 ++++++++++++++++++++++++++++
 gtksourceview/gtksourcecompletionprovider.c | 14 +++++++++++++-
 3 files changed, 41 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index 569a64ff..3dbecba5 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -1449,7 +1449,6 @@ add_attributes (PangoAttrList **attrs,
  * gtk_source_completion_fuzzy_highlight:
  * @haystack: the string to be highlighted
  * @casefold_query: the typed-text used to highlight @haystack
- * @attrs: a #PangoAttrList to add the attributes to
  *
  * This will add &lt;b&gt; tags around matched characters in @haystack
  * based on @casefold_query.
diff --git a/gtksourceview/gtksourcecompletioncontext.c b/gtksourceview/gtksourcecompletioncontext.c
index 9f9dc27e..22e8d4bc 100644
--- a/gtksourceview/gtksourcecompletioncontext.c
+++ b/gtksourceview/gtksourcecompletioncontext.c
@@ -25,6 +25,7 @@
 
 #include <string.h>
 
+#include "gtksourcebuffer.h"
 #include "gtksourcecompletion.h"
 #include "gtksourcecompletioncontext-private.h"
 #include "gtksourcecompletionproposal.h"
@@ -1005,3 +1006,30 @@ gtk_source_completion_context_get_activation (GtkSourceCompletionContext *self)
 
        return self->activation;
 }
+
+/**
+ * gtk_source_completion_context_get_language:
+ * @self: a #GtkSourceCompletionContext
+ *
+ * Gets the language of the underlying buffer, if any.
+ *
+ * Returns: (nullable) (transfer none): a #GtkSourceLanguage or %NULL
+ *
+ * Since: 5.0
+ */
+GtkSourceLanguage *
+gtk_source_completion_context_get_language (GtkSourceCompletionContext *self)
+{
+       GtkSourceBuffer *buffer;
+
+       g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_CONTEXT (self), NULL);
+
+       buffer = gtk_source_completion_context_get_buffer (self);
+
+       if (buffer != NULL)
+       {
+               return gtk_source_buffer_get_language (buffer);
+       }
+
+       return NULL;
+}
diff --git a/gtksourceview/gtksourcecompletionprovider.c b/gtksourceview/gtksourcecompletionprovider.c
index bda9b99b..6a314a9e 100644
--- a/gtksourceview/gtksourcecompletionprovider.c
+++ b/gtksourceview/gtksourcecompletionprovider.c
@@ -172,6 +172,18 @@ gtk_source_completion_provider_populate_async (GtkSourceCompletionProvider *self
        GTK_SOURCE_COMPLETION_PROVIDER_GET_IFACE (self)->populate_async (self, context, cancellable, 
callback, user_data);
 }
 
+/**
+ * gtk_source_completion_provider_populate_finish:
+ * @self: a #GtkSourceCompletionProvider
+ * @result: a #GAsyncResult provided to callback
+ * @error: a location for a #GError, or %NULL
+ *
+ * Completes an asynchronous operation to populate a completion provider.
+ *
+ * Returns: (transfer full): a #GListModel of #GtkSourceCompletionProposal
+ *
+ * Since: 5.0
+ */
 GListModel *
 gtk_source_completion_provider_populate_finish (GtkSourceCompletionProvider  *self,
                                                 GAsyncResult                 *result,
@@ -228,7 +240,7 @@ gtk_source_completion_provider_activate (GtkSourceCompletionProvider *self,
 /**
  * gtk_source_completion_provider_list_alternates:
  * @self: a #GtkSourceCompletionProvider
- * @content: a #GtkSourceCompletionContext
+ * @context: a #GtkSourceCompletionContext
  * @proposal: a #GtkSourceCompletionProposal
  *
  * Providers should return a list of alternates to @proposal or %NULL if


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