[gnome-builder] langserv-client: add ::published-diagnostics signal
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] langserv-client: add ::published-diagnostics signal
- Date: Wed, 26 Oct 2016 21:19:58 +0000 (UTC)
commit 51c606faad41e4ab4db3819af7cf85e01dc8638b
Author: Christian Hergert <chergert redhat com>
Date: Wed Oct 26 14:19:09 2016 -0700
langserv-client: add ::published-diagnostics signal
This can be used by diagnostic providers to invalidate their diagnostics
when appropriate.
libide/langserv/ide-langserv-client.c | 19 ++++++++++++++++++-
libide/langserv/ide-langserv-client.h | 3 +++
2 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/libide/langserv/ide-langserv-client.c b/libide/langserv/ide-langserv-client.c
index b04571d..e3eafe2 100644
--- a/libide/langserv/ide-langserv-client.c
+++ b/libide/langserv/ide-langserv-client.c
@@ -68,6 +68,7 @@ enum {
};
enum {
+ PUBLISHED_DIAGNOSTICS,
NOTIFICATION,
SUPPORTS_LANGUAGE,
N_SIGNALS
@@ -564,6 +565,7 @@ ide_langserv_client_text_document_publish_diagnostics (IdeLangservClient *self,
{
g_autoptr(IdeFile) ifile = NULL;
g_autoptr(GFile) file = NULL;
+ g_autoptr(IdeDiagnostics) diagnostics = NULL;
IDE_TRACE_MSG ("Diagnostics received for %s", uri);
@@ -572,10 +574,13 @@ ide_langserv_client_text_document_publish_diagnostics (IdeLangservClient *self,
"file", file,
"context", ide_object_get_context (IDE_OBJECT (self)),
NULL);
+ diagnostics = ide_langserv_client_translate_diagnostics (self, ifile, json_diagnostics);
+
+ g_signal_emit (self, signals [PUBLISHED_DIAGNOSTICS], 0, file, diagnostics);
g_hash_table_insert (priv->diagnostics_by_file,
g_steal_pointer (&file),
- ide_langserv_client_translate_diagnostics (self, ifile, json_diagnostics));
+ g_steal_pointer (&diagnostics));
}
IDE_EXIT;
@@ -745,6 +750,18 @@ ide_langserv_client_class_init (IdeLangservClientClass *klass)
G_TYPE_BOOLEAN,
1,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ signals [PUBLISHED_DIAGNOSTICS] =
+ g_signal_new ("published-diagnostics",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (IdeLangservClientClass, published_diagnostics),
+ NULL, NULL, NULL,
+ G_TYPE_NONE,
+ 2,
+ G_TYPE_FILE,
+ IDE_TYPE_DIAGNOSTICS);
+
}
static void
diff --git a/libide/langserv/ide-langserv-client.h b/libide/langserv/ide-langserv-client.h
index 6c88d6e..6e6d11e 100644
--- a/libide/langserv/ide-langserv-client.h
+++ b/libide/langserv/ide-langserv-client.h
@@ -38,6 +38,9 @@ struct _IdeLangservClientClass
JsonNode *params);
gboolean (*supports_language) (IdeLangservClient *self,
const gchar *language_id);
+ void (*published_diagnostics) (IdeLangservClient *self,
+ GFile *file,
+ IdeDiagnostics *diagnostics);
gpointer _reserved1;
gpointer _reserved2;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]