[gnome-builder/wip/libide] libide: register default diagnostician
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/libide] libide: register default diagnostician
- Date: Sun, 15 Feb 2015 08:20:48 +0000 (UTC)
commit cd023798e4b96ca506751dac8e1afb1056c2affa
Author: Christian Hergert <christian hergert me>
Date: Sun Feb 15 00:19:29 2015 -0800
libide: register default diagnostician
libide/ide-language.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-language.c b/libide/ide-language.c
index 3118d6a..b39c383 100644
--- a/libide/ide-language.c
+++ b/libide/ide-language.c
@@ -19,8 +19,10 @@
#include <glib/gi18n.h>
#include "ide-diagnostician.h"
+#include "ide-gca-diagnostic-provider.h"
#include "ide-highlighter.h"
#include "ide-indenter.h"
+#include "ide-internal.h"
#include "ide-language.h"
#include "ide-refactory.h"
#include "ide-symbol-resolver.h"
@@ -45,6 +47,7 @@ enum {
};
static GParamSpec *gParamSpecs [LAST_PROP];
+static IdeDiagnostician *gDiagnostician;
/**
* ide_language_get_diagnostician:
@@ -72,6 +75,27 @@ ide_language_get_diagnostician (IdeLanguage *self)
return NULL;
}
+static IdeDiagnostician *
+ide_language_real_get_diagnostician (IdeLanguage *self)
+{
+ if (!gDiagnostician)
+ {
+ IdeDiagnosticProvider *provider;
+ IdeContext *context;
+
+ context = ide_object_get_context (IDE_OBJECT (self));
+ gDiagnostician = g_object_new (IDE_TYPE_DIAGNOSTICIAN,
+ "context", context,
+ NULL);
+ provider = g_object_new (IDE_TYPE_GCA_DIAGNOSTIC_PROVIDER,
+ "context", context,
+ NULL);
+ _ide_diagnostician_add_provider (gDiagnostician, provider);
+ }
+
+ return gDiagnostician;
+}
+
/**
* ide_language_get_highlighter:
*
@@ -269,6 +293,8 @@ ide_language_class_init (IdeLanguageClass *klass)
object_class->get_property = ide_language_get_property;
object_class->set_property = ide_language_set_property;
+ klass->get_diagnostician = ide_language_real_get_diagnostician;
+
gParamSpecs [PROP_DIAGNOSTICIAN] =
g_param_spec_object ("diagnostician",
_("Diagnostician"),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]