[gnome-builder] libide: add vfunc to get completion providers from language



commit dfc2e3705c8d959531866746e947c368affe0e84
Author: Christian Hergert <christian hergert me>
Date:   Sat Mar 14 17:50:09 2015 -0700

    libide: add vfunc to get completion providers from language

 libide/ide-language.c |   20 ++++++++++++++++++++
 libide/ide-language.h |   32 +++++++++++++++++---------------
 2 files changed, 37 insertions(+), 15 deletions(-)
---
diff --git a/libide/ide-language.c b/libide/ide-language.c
index 150f2e6..22553ec 100644
--- a/libide/ide-language.c
+++ b/libide/ide-language.c
@@ -76,6 +76,26 @@ ide_language_get_source_language (IdeLanguage *self)
 }
 
 /**
+ * ide_language_get_completion_providers:
+ * @self: An #IdeLanguage.
+ *
+ * Gets the completion providers that can be used to autocomplete for this language.
+ *
+ * Returns: (transfer full) (element-type GtkSourceCompletionProvider*): A
+ *   #GList of #GtkSourceCompletionProvider.
+ */
+GList *
+ide_language_get_completion_providers (IdeLanguage *self)
+{
+  g_return_val_if_fail (IDE_IS_LANGUAGE (self), NULL);
+
+  if (IDE_LANGUAGE_GET_CLASS (self)->get_completion_providers)
+    return IDE_LANGUAGE_GET_CLASS (self)->get_completion_providers (self);
+
+  return NULL;
+}
+
+/**
  * ide_language_get_diagnostician:
  *
  * Returns the #IdeDiagnostician for the #IdeLanguage.
diff --git a/libide/ide-language.h b/libide/ide-language.h
index 4817f07..ad6c259 100644
--- a/libide/ide-language.h
+++ b/libide/ide-language.h
@@ -34,23 +34,25 @@ struct _IdeLanguageClass
 {
   IdeObjectClass parent;
 
-  IdeDiagnostician  *(*get_diagnostician)   (IdeLanguage *self);
-  IdeHighlighter    *(*get_highlighter)     (IdeLanguage *self);
-  IdeIndenter       *(*get_indenter)        (IdeLanguage *self);
-  const gchar       *(*get_name)            (IdeLanguage *self);
-  IdeRefactory      *(*get_refactory)       (IdeLanguage *self);
-  GtkSourceLanguage *(*get_source_language) (IdeLanguage *self);
-  IdeSymbolResolver *(*get_symbol_resolver) (IdeLanguage *self);
+  IdeDiagnostician  *(*get_diagnostician)        (IdeLanguage *self);
+  IdeHighlighter    *(*get_highlighter)          (IdeLanguage *self);
+  IdeIndenter       *(*get_indenter)             (IdeLanguage *self);
+  const gchar       *(*get_name)                 (IdeLanguage *self);
+  IdeRefactory      *(*get_refactory)            (IdeLanguage *self);
+  GtkSourceLanguage *(*get_source_language)      (IdeLanguage *self);
+  IdeSymbolResolver *(*get_symbol_resolver)      (IdeLanguage *self);
+  GList             *(*get_completion_providers) (IdeLanguage *self);
 };
 
-IdeDiagnostician  *ide_language_get_diagnostician   (IdeLanguage *self);
-IdeHighlighter    *ide_language_get_highlighter     (IdeLanguage *self);
-const gchar       *ide_language_get_id              (IdeLanguage *self);
-IdeIndenter       *ide_language_get_indenter        (IdeLanguage *self);
-const gchar       *ide_language_get_name            (IdeLanguage *self);
-IdeRefactory      *ide_language_get_refactory       (IdeLanguage *self);
-IdeSymbolResolver *ide_language_get_symbol_resolver (IdeLanguage *self);
-GtkSourceLanguage *ide_language_get_source_language (IdeLanguage *self);
+IdeDiagnostician  *ide_language_get_diagnostician        (IdeLanguage *self);
+IdeHighlighter    *ide_language_get_highlighter          (IdeLanguage *self);
+const gchar       *ide_language_get_id                   (IdeLanguage *self);
+IdeIndenter       *ide_language_get_indenter             (IdeLanguage *self);
+const gchar       *ide_language_get_name                 (IdeLanguage *self);
+IdeRefactory      *ide_language_get_refactory            (IdeLanguage *self);
+IdeSymbolResolver *ide_language_get_symbol_resolver      (IdeLanguage *self);
+GtkSourceLanguage *ide_language_get_source_language      (IdeLanguage *self);
+GList             *ide_language_get_completion_providers (IdeLanguage *self);
 
 G_END_DECLS
 


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