[gnome-builder] code-assist: parse file when loaded
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] code-assist: parse file when loaded
- Date: Tue, 21 Oct 2014 23:17:20 +0000 (UTC)
commit dc682d7d61dc4fae53275656ed8b63dc9a35c0bc
Author: Christian Hergert <christian hergert me>
Date: Tue Oct 21 16:17:13 2014 -0700
code-assist: parse file when loaded
src/editor/gb-editor-code-assistant.c | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/src/editor/gb-editor-code-assistant.c b/src/editor/gb-editor-code-assistant.c
index f6dddc5..1e41c6a 100644
--- a/src/editor/gb-editor-code-assistant.c
+++ b/src/editor/gb-editor-code-assistant.c
@@ -317,22 +317,26 @@ gb_editor_code_assistant_parse (gpointer user_data)
}
static void
+gb_editor_code_assistant_queue_parse (GbEditorTab *tab)
+{
+ g_return_if_fail (GB_IS_EDITOR_TAB (tab));
+
+ if (tab->priv->gca_parse_timeout)
+ g_source_remove (tab->priv->gca_parse_timeout);
+
+ tab->priv->gca_parse_timeout = g_timeout_add (PARSE_TIMEOUT_MSEC,
+ gb_editor_code_assistant_parse,
+ tab);
+}
+
+static void
gb_editor_code_assistant_buffer_changed (GbEditorDocument *document,
GbEditorTab *tab)
{
- GbEditorTabPrivate *priv;
-
g_return_if_fail (GB_IS_EDITOR_TAB (tab));
g_return_if_fail (GB_IS_EDITOR_DOCUMENT (document));
- priv = tab->priv;
-
- if (priv->gca_parse_timeout)
- g_source_remove (priv->gca_parse_timeout);
-
- priv->gca_parse_timeout = g_timeout_add (PARSE_TIMEOUT_MSEC,
- gb_editor_code_assistant_parse,
- tab);
+ gb_editor_code_assistant_queue_parse (tab);
}
static gboolean
@@ -571,6 +575,8 @@ service_proxy_new_cb (GObject *source_object,
GTK_TEXT_WINDOW_LEFT);
gtk_source_gutter_insert (gutter, priv->gca_gutter, -100);
+ gb_editor_code_assistant_queue_parse (tab);
+
cleanup:
g_object_unref (tab);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]