GNOME Bugzilla – Bug 771863
gca: Return original lang_id if no remap is found
Last modified: 2016-09-23 10:04:49 UTC
This fixes an issue I mentioned in IRC where builder would report 'ide-diagnostician[9552]: WARNING: No language specified' for python files. The remap function was only returning the remapped langauges since 105ffe5. I'm not sure my use of g_autofree is correct here, please check.
Created attachment 336143 [details] [review] 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.
Review of attachment 336143 [details] [review]: ::: plugins/gnome-code-assistance/ide-gca-service.c @@ +96,3 @@ { static GHashTable *remap; + g_autofree gchar *remapped_lang_id = NULL; remapped_lang_id are static strings from the hash table so we can't/don't want to free them, just return them ( and you can see that the function returned type is const )
Created attachment 336148 [details] [review] 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.
Attachment 336148 [details] pushed as 9d3b3d9 - gca: Return original lang_id if no remap is found
thanks for the patch