[gnome-builder] diagnostics: add IdeDiagnosticProvider::load vfunc
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] diagnostics: add IdeDiagnosticProvider::load vfunc
- Date: Fri, 28 Oct 2016 11:01:33 +0000 (UTC)
commit 1672a8a91e0169698b723cd38795ed280b4f7de1
Author: Christian Hergert <chergert redhat com>
Date: Fri Oct 28 04:01:10 2016 -0700
diagnostics: add IdeDiagnosticProvider::load vfunc
This simplifies the setup of diagnostics after context has been set.
libide/diagnostics/ide-diagnostic-provider.c | 9 +++++++++
libide/diagnostics/ide-diagnostic-provider.h | 2 ++
libide/diagnostics/ide-diagnostics-manager.c | 6 ++++++
plugins/rust-langserv/rust_langserv_plugin.py | 3 +--
4 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/libide/diagnostics/ide-diagnostic-provider.c b/libide/diagnostics/ide-diagnostic-provider.c
index 60d1ba4..4d848f9 100644
--- a/libide/diagnostics/ide-diagnostic-provider.c
+++ b/libide/diagnostics/ide-diagnostic-provider.c
@@ -95,3 +95,12 @@ ide_diagnostic_provider_emit_invalidated (IdeDiagnosticProvider *self)
g_signal_emit (self, signals [INVALIDATED], 0);
}
+
+void
+ide_diagnostic_provider_load (IdeDiagnosticProvider *self)
+{
+ g_return_if_fail (IDE_IS_DIAGNOSTIC_PROVIDER (self));
+
+ if (IDE_DIAGNOSTIC_PROVIDER_GET_IFACE (self)->load)
+ IDE_DIAGNOSTIC_PROVIDER_GET_IFACE (self)->load (self);
+}
diff --git a/libide/diagnostics/ide-diagnostic-provider.h b/libide/diagnostics/ide-diagnostic-provider.h
index 453cc2a..a297618 100644
--- a/libide/diagnostics/ide-diagnostic-provider.h
+++ b/libide/diagnostics/ide-diagnostic-provider.h
@@ -41,6 +41,7 @@ struct _IdeDiagnosticProviderInterface
IdeDiagnostics *(*diagnose_finish) (IdeDiagnosticProvider *self,
GAsyncResult *result,
GError **error);
+ void (*load) (IdeDiagnosticProvider *self);
};
void ide_diagnostic_provider_diagnose_async (IdeDiagnosticProvider *self,
@@ -52,6 +53,7 @@ IdeDiagnostics *ide_diagnostic_provider_diagnose_finish (IdeDiagnosticProvider
GAsyncResult *result,
GError **error);
void ide_diagnostic_provider_emit_invalidated (IdeDiagnosticProvider *self);
+void ide_diagnostic_provider_load (IdeDiagnosticProvider *self);
G_END_DECLS
diff --git a/libide/diagnostics/ide-diagnostics-manager.c b/libide/diagnostics/ide-diagnostics-manager.c
index a068782..366d201 100644
--- a/libide/diagnostics/ide-diagnostics-manager.c
+++ b/libide/diagnostics/ide-diagnostics-manager.c
@@ -732,6 +732,8 @@ ide_diagnostics_manager_extension_added (IdeExtensionSetAdapter *adapter,
self,
G_CONNECT_SWAPPED);
+ ide_diagnostic_provider_load (provider);
+
ide_diagnostics_group_queue_diagnose (group, self);
IDE_EXIT;
@@ -992,6 +994,10 @@ ide_diagnostics_manager_buffer_loaded (IdeDiagnosticsManager *self,
self,
0);
+ ide_extension_set_adapter_foreach (group->adapter,
+ ide_diagnostics_manager_extension_added,
+ self);
+
ide_diagnostics_group_queue_diagnose (group, self);
IDE_EXIT;
diff --git a/plugins/rust-langserv/rust_langserv_plugin.py b/plugins/rust-langserv/rust_langserv_plugin.py
index 92be0da..e5dcf0b 100644
--- a/plugins/rust-langserv/rust_langserv_plugin.py
+++ b/plugins/rust-langserv/rust_langserv_plugin.py
@@ -139,8 +139,7 @@ class RustService(Ide.Object, Ide.Service):
self.bind_property('client', provider, 'client', GObject.BindingFlags.DEFAULT)
class RustDiagnosticProvider(Ide.LangservDiagnosticProvider):
- def __init__(self, *args, **kwargs):
- super().__init__(*args, **kwargs)
+ def do_load(self):
RustService.bind_client(self)
class RustCompletionProvider(Ide.LangservCompletionProvider):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]