[gnome-builder] gca: Return original lang_id if no remap is found



commit 9d3b3d9f2c9ebabf0249ec076bc0c86f7e6c135c
Author: Marinus Schraal <mschraal gnome org>
Date:   Fri Sep 23 10:24:19 2016 +0200

    gca: Return original lang_id if no remap is found
    
    If remap_langauge fails to remap, it doesn't mean there isn't a
    valid language id. So don't return NULL, but return the original lang_id
    instead for further processing. This fixes an issue with other languages
    than the remappable ones not being considered for diagnostics.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771863

 plugins/gnome-code-assistance/ide-gca-service.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/plugins/gnome-code-assistance/ide-gca-service.c b/plugins/gnome-code-assistance/ide-gca-service.c
index 3e16a30..bfba54d 100644
--- a/plugins/gnome-code-assistance/ide-gca-service.c
+++ b/plugins/gnome-code-assistance/ide-gca-service.c
@@ -95,6 +95,7 @@ static const gchar *
 remap_language (const gchar *lang_id)
 {
   static GHashTable *remap;
+  gchar *remapped_lang_id;
 
   if (lang_id == NULL)
     return NULL;
@@ -110,7 +111,12 @@ remap_language (const gchar *lang_id)
 #undef ADD_REMAP
     }
 
-  return g_hash_table_lookup (remap, lang_id);
+  remapped_lang_id = g_hash_table_lookup (remap, lang_id);
+
+  if (remapped_lang_id == NULL)
+    return lang_id;
+  else
+    return remapped_lang_id;
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]