[gnome-builder] libide: ensure valid language for gnome-code-assistance
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide: ensure valid language for gnome-code-assistance
- Date: Mon, 23 Mar 2015 23:49:59 +0000 (UTC)
commit 293e7c5cf3e76eb360bd46b4d120b6e5820401c3
Author: Christian Hergert <christian hergert me>
Date: Mon Mar 2 23:30:49 2015 -0800
libide: ensure valid language for gnome-code-assistance
libide/gca/ide-gca-diagnostic-provider.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/libide/gca/ide-gca-diagnostic-provider.c b/libide/gca/ide-gca-diagnostic-provider.c
index 0279504..54482df 100644
--- a/libide/gca/ide-gca-diagnostic-provider.c
+++ b/libide/gca/ide-gca-diagnostic-provider.c
@@ -363,10 +363,20 @@ ide_gca_diagnostic_provider_diagnose_async (IdeDiagnosticProvider *provider,
task = g_task_new (self, cancellable, callback, user_data);
- context = ide_object_get_context (IDE_OBJECT (provider));
- service = ide_context_get_service_typed (context, IDE_TYPE_GCA_SERVICE);
language = ide_file_get_language (file);
language_id = ide_language_get_id (language);
+
+ if (!language_id)
+ {
+ g_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ "No language specified, code assistance not supported.");
+ return;
+ }
+
+ context = ide_object_get_context (IDE_OBJECT (provider));
+ service = ide_context_get_service_typed (context, IDE_TYPE_GCA_SERVICE);
files = ide_context_get_unsaved_files (context);
gfile = ide_file_get_file (file);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]