After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771863 - gca: Return original lang_id if no remap is found
gca: Return original lang_id if no remap is found
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: plugins
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-09-23 08:32 UTC by Marinus Schraal
Modified: 2016-09-23 10:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gca: Return original lang_id if no remap is found (1.39 KB, patch)
2016-09-23 08:32 UTC, Marinus Schraal
none Details | Review
gca: Return original lang_id if no remap is found (1.37 KB, patch)
2016-09-23 09:44 UTC, Marinus Schraal
committed Details | Review

Description Marinus Schraal 2016-09-23 08:32:53 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.
Comment 1 Marinus Schraal 2016-09-23 08:32:56 UTC
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.
Comment 2 sébastien lafargue 2016-09-23 09:08:56 UTC
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 )
Comment 3 Marinus Schraal 2016-09-23 09:44:29 UTC
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.
Comment 4 sébastien lafargue 2016-09-23 10:04:23 UTC
Attachment 336148 [details] pushed as 9d3b3d9 - gca: Return original lang_id if no remap is found
Comment 5 sébastien lafargue 2016-09-23 10:04:49 UTC
thanks for the patch