[gnome-builder] code-index: disable lookup_symbol when no project is loaded
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] code-index: disable lookup_symbol when no project is loaded
- Date: Mon, 25 Feb 2019 22:26:49 +0000 (UTC)
commit 039c78ee8ae939e7b9c52d79a923de2c643526f8
Author: Christian Hergert <chergert redhat com>
Date: Mon Feb 25 14:26:30 2019 -0800
code-index: disable lookup_symbol when no project is loaded
src/plugins/code-index/ide-code-index-symbol-resolver.c | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/src/plugins/code-index/ide-code-index-symbol-resolver.c
b/src/plugins/code-index/ide-code-index-symbol-resolver.c
index cbe53b84e..358aceca9 100644
--- a/src/plugins/code-index/ide-code-index-symbol-resolver.c
+++ b/src/plugins/code-index/ide-code-index-symbol-resolver.c
@@ -159,6 +159,15 @@ ide_code_index_symbol_resolver_lookup_symbol_async (IdeSymbolResolver *resolve
context = ide_object_get_context (IDE_OBJECT (self));
g_assert (IDE_IS_CONTEXT (context));
+ if (!ide_context_has_project (context))
+ {
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ "No project loaded, cannot use code-index");
+ return;
+ }
+
service = gbp_code_index_service_from_context (context);
g_assert (GBP_IS_CODE_INDEX_SERVICE (service));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]