[gnome-builder/wip/chergert/completion] gi: fix some introspection notations



commit 4cf479ec9fa7afcb627cb3fb6f15f166c737ea7d
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jun 7 19:31:57 2018 -0700

    gi: fix some introspection notations

 src/libide/completion/ide-completion-context.h     |  2 +-
 src/libide/completion/ide-completion.c             | 24 +++++++++++-----------
 src/libide/langserv/ide-langserv-completion-item.c | 11 ++++++++++
 3 files changed, 24 insertions(+), 13 deletions(-)
---
diff --git a/src/libide/completion/ide-completion-context.h b/src/libide/completion/ide-completion-context.h
index 9e368cd2d..1c8432292 100644
--- a/src/libide/completion/ide-completion-context.h
+++ b/src/libide/completion/ide-completion-context.h
@@ -44,7 +44,7 @@ gboolean       ide_completion_context_is_empty                   (IdeCompletionC
 IDE_AVAILABLE_IN_3_30
 void           ide_completion_context_set_proposals_for_provider (IdeCompletionContext  *self,
                                                                   IdeCompletionProvider *provider,
-                                                                  GListModel            *model);
+                                                                  GListModel            *results);
 IDE_AVAILABLE_IN_3_30
 IdeCompletion *ide_completion_context_get_completion             (IdeCompletionContext   *self);
 IDE_AVAILABLE_IN_3_30
diff --git a/src/libide/completion/ide-completion.c b/src/libide/completion/ide-completion.c
index 7f9f7a7f4..2943a16e9 100644
--- a/src/libide/completion/ide-completion.c
+++ b/src/libide/completion/ide-completion.c
@@ -1675,19 +1675,19 @@ ide_completion_fuzzy_match (const gchar *haystack,
 
 /**
  * ide_completion_fuzzy_highlight:
- * @str: the string to be highlighted
- * @match: the typed-text used to highlight @str
+ * @haystack: the string to be highlighted
+ * @casefold_query: the typed-text used to highlight @haystack
  *
- * This will add &lt;b&gt; tags around matched characters in @str
- * based on @match.
+ * This will add &lt;b&gt; tags around matched characters in @haystack
+ * based on @casefold_query.
  *
  * Returns: a newly allocated string
  *
  * Since: 3.30
  */
 gchar *
-ide_completion_fuzzy_highlight (const gchar *str,
-                                const gchar *match)
+ide_completion_fuzzy_highlight (const gchar *haystack,
+                                const gchar *casefold_query)
 {
   static const gchar *begin = "<b>";
   static const gchar *end = "</b>";
@@ -1696,15 +1696,15 @@ ide_completion_fuzzy_highlight (const gchar *str,
   gunichar match_ch;
   gboolean element_open = FALSE;
 
-  if (str == NULL || match == NULL)
-    return g_strdup (str);
+  if (haystack == NULL || casefold_query == NULL)
+    return g_strdup (haystack);
 
   ret = g_string_new (NULL);
 
-  for (; *str; str = g_utf8_next_char (str))
+  for (; *haystack; haystack = g_utf8_next_char (haystack))
     {
-      str_ch = g_utf8_get_char (str);
-      match_ch = g_utf8_get_char (match);
+      str_ch = g_utf8_get_char (haystack);
+      match_ch = g_utf8_get_char (casefold_query);
 
       if ((str_ch == match_ch) || (g_unichar_tolower (str_ch) == g_unichar_tolower (match_ch)))
         {
@@ -1717,7 +1717,7 @@ ide_completion_fuzzy_highlight (const gchar *str,
           g_string_append_unichar (ret, str_ch);
 
           /* TODO: We could seek to the next char and append in a batch. */
-          match = g_utf8_next_char (match);
+          casefold_query = g_utf8_next_char (casefold_query);
         }
       else
         {
diff --git a/src/libide/langserv/ide-langserv-completion-item.c 
b/src/libide/langserv/ide-langserv-completion-item.c
index 57bb93e44..bf1f41f05 100644
--- a/src/libide/langserv/ide-langserv-completion-item.c
+++ b/src/libide/langserv/ide-langserv-completion-item.c
@@ -124,6 +124,17 @@ ide_langserv_completion_item_get_detail (IdeLangservCompletionItem *self)
   return self->detail;
 }
 
+/**
+ * ide_langserv_completion_item_get_snippet:
+ * @self: a #IdeLangservCompletionItem
+ *
+ * Creates a new snippet for the completion item to be inserted into
+ * the document.
+ *
+ * Returns: (transfer full): an #IdeSnippet
+ *
+ * Since: 3.30
+ */
 IdeSnippet *
 ide_langserv_completion_item_get_snippet (IdeLangservCompletionItem *self)
 {


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