Commit a3b225f4 authored by Christian Hergert's avatar Christian Hergert
Browse files

code-index: more assertions and cleanup

parent 3e516161
......@@ -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
......@@ -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);
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment