[gnome-builder] code-index: more assertions and cleanup
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] code-index: more assertions and cleanup
- Date: Thu, 18 Jan 2018 14:43:42 +0000 (UTC)
commit a3b225f46054d387b38ae985291cf362a19b0ca0
Author: Christian Hergert <chergert redhat com>
Date: Tue Jan 16 22:52:23 2018 -0800
code-index: more assertions and cleanup
src/plugins/code-index/ide-code-index-index.h | 44 +++++++++++-----------
.../code-index/ide-code-index-search-provider.c | 5 +++
.../code-index/ide-code-index-search-provider.h | 2 +-
3 files changed, 28 insertions(+), 23 deletions(-)
---
diff --git a/src/plugins/code-index/ide-code-index-index.h b/src/plugins/code-index/ide-code-index-index.h
index fd68ebb6a..9c1a20c11 100644
--- a/src/plugins/code-index/ide-code-index-index.h
+++ b/src/plugins/code-index/ide-code-index-index.h
@@ -26,27 +26,27 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (IdeCodeIndexIndex, ide_code_index_index, IDE, CODE_INDEX_INDEX, IdeObject)
-IdeCodeIndexIndex *ide_code_index_index_new (IdeContext *context);
-gboolean ide_code_index_index_load_if_nmod (IdeCodeIndexIndex *self,
- GFile *directory,
- GPtrArray *files,
- GTimeVal mod_time,
- GCancellable *cancellable,
- GError **error);
-gboolean ide_code_index_index_load (IdeCodeIndexIndex *self,
- GFile *directory,
- GCancellable *cancellable,
- GError **error);
-void ide_code_index_index_populate_async (IdeCodeIndexIndex *self,
- const gchar *query,
- gsize max_results,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-GPtrArray *ide_code_index_index_populate_finish (IdeCodeIndexIndex *self,
- GAsyncResult *result,
- GError **error);
-IdeSymbol *ide_code_index_index_lookup_symbol (IdeCodeIndexIndex *self,
- const gchar *key);
+IdeCodeIndexIndex *ide_code_index_index_new (IdeContext *context);
+gboolean ide_code_index_index_load_if_nmod (IdeCodeIndexIndex *self,
+ GFile *directory,
+ GPtrArray *files,
+ GTimeVal mod_time,
+ GCancellable *cancellable,
+ GError **error);
+gboolean ide_code_index_index_load (IdeCodeIndexIndex *self,
+ GFile *directory,
+ GCancellable *cancellable,
+ GError **error);
+IdeSymbol *ide_code_index_index_lookup_symbol (IdeCodeIndexIndex *self,
+ const gchar *key);
+void ide_code_index_index_populate_async (IdeCodeIndexIndex *self,
+ const gchar *query,
+ gsize max_results,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GPtrArray *ide_code_index_index_populate_finish (IdeCodeIndexIndex *self,
+ GAsyncResult *result,
+ GError **error);
G_END_DECLS
diff --git a/src/plugins/code-index/ide-code-index-search-provider.c
b/src/plugins/code-index/ide-code-index-search-provider.c
index 42759a6dd..2a85e7962 100644
--- a/src/plugins/code-index/ide-code-index-search-provider.c
+++ b/src/plugins/code-index/ide-code-index-search-provider.c
@@ -68,8 +68,13 @@ ide_code_index_search_provider_search_async (IdeSearchProvider *provider,
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
context = ide_object_get_context (IDE_OBJECT (self));
+ g_assert (IDE_IS_CONTEXT (context));
+
service = ide_context_get_service_typed (context, IDE_TYPE_CODE_INDEX_SERVICE);
+ g_assert (IDE_IS_CODE_INDEX_SERVICE (service));
+
index = ide_code_index_service_get_index (service);
+ g_assert (IDE_IS_CODE_INDEX_INDEX (index));
task = g_task_new (self, cancellable, callback, user_data);
g_task_set_source_tag (task, ide_code_index_search_provider_search_async);
diff --git a/src/plugins/code-index/ide-code-index-search-provider.h
b/src/plugins/code-index/ide-code-index-search-provider.h
index 11c3fac05..f4cf34ee6 100644
--- a/src/plugins/code-index/ide-code-index-search-provider.h
+++ b/src/plugins/code-index/ide-code-index-search-provider.h
@@ -22,7 +22,7 @@
G_BEGIN_DECLS
-#define IDE_TYPE_CODE_INDEX_SEARCH_PROVIDER (ide_code_index_search_provider_get_type ())
+#define IDE_TYPE_CODE_INDEX_SEARCH_PROVIDER (ide_code_index_search_provider_get_type())
G_DECLARE_FINAL_TYPE (IdeCodeIndexSearchProvider, ide_code_index_search_provider, IDE,
CODE_INDEX_SEARCH_PROVIDER, IdeObject)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]