GNOME Bugzilla – Bug 626349
polishing the vala plugin
Last modified: 2010-08-26 17:11:00 UTC
See attached patches. Mainly removing critical warnings and fixing calltips for delegates.
Created attachment 167352 [details] [review] language-support-vala: better completion for local variables
Created attachment 167353 [details] [review] language-support-vala: fix critical warnings if there are parsing errors
Created attachment 167354 [details] [review] language-support-vala: remove remaining critical warnings
Created attachment 167355 [details] [review] language-support-vala: correctly handle calltip showing for delegates
Review of attachment 167352 [details] [review]: Thanks!
Review of attachment 167353 [details] [review]: Thanks!
Review of attachment 167354 [details] [review]: Thanks!
Review of attachment 167355 [details] [review]: Thanks!
Thank you very much for all the patches, they seem to make things a lot better. I still get some warnings though when starting up anjuta with a vala file loaded from the last session: ** (anjuta:4557): CRITICAL **: vala_symbol_get_scope: assertion `self != NULL' failed ** (anjuta:4557): CRITICAL **: vala_scope_lookup: assertion `self != NULL' failed ** (anjuta:4557): CRITICAL **: vala_symbol_get_scope: assertion `self != NULL' failed ** (anjuta:4557): CRITICAL **: vala_scope_lookup: assertion `self != NULL' failed ** (anjuta:4557): CRITICAL **: vala_symbol_get_scope: assertion `self != NULL' failed ** (anjuta:4557): CRITICAL **: vala_scope_lookup: assertion `self != NULL' failed ** (anjuta:4557): CRITICAL **: vala_symbol_get_scope: assertion `self != NULL' failed ** (anjuta:4557): CRITICAL **: vala_scope_lookup: assertion `self != NULL' failed ** (anjuta:4557): CRITICAL **: vala_symbol_get_scope: assertion `self != NULL' failed ** (anjuta:4557): CRITICAL **: vala_scope_lookup: assertion `self != NULL' failed Another thing is that the vala plugin doesn't have any preferences. I think it would be ok if you use the preferences from the language-support-cpp-java plugin as it is loaded anyway for autocompletion. Here I mean the five settings on the autocompletion page. Again, thanks a lot for your work!
(In reply to comment #10) > Thank you very much for all the patches, they seem to make things a lot better. > > I still get some warnings though when starting up anjuta with a vala file > loaded from the last session: > > ** (anjuta:4557): CRITICAL **: vala_symbol_get_scope: assertion `self != NULL' > failed > > ** (anjuta:4557): CRITICAL **: vala_scope_lookup: assertion `self != NULL' > failed Well, I don't see these warnings anymore, and don't see how they could happen, however I still have some warnings: ** (anjuta:2097): CRITICAL **: vala_genie_parser_parse: assertion `context != NULL' failed ** (anjuta:2097): CRITICAL **: vala_symbol_resolver_resolve: assertion `context != NULL' failed ** (anjuta:2097): CRITICAL **: vala_semantic_analyzer_analyze: assertion `context != NULL' failed when I have a vala file open but is not the active document. The plugin is activated then deactivated so fast that the thread I launch for parsing isn't done yet. I could argue this is a bug in the language manager. And (anjuta:2097): language-support-vala-CRITICAL **: vala_plugin_lookup_symbol: assertion `block != NULL' failed when I try to type outside of a code block (e.g. declaring a field). I'll leave this until I find a better way to complete in these situations. > Another thing is that the vala plugin doesn't have any preferences. I think it > would be ok if you use the preferences from the language-support-cpp-java > plugin as it is loaded anyway for autocompletion. > > Here I mean the five settings on the autocompletion page. Done :-)
Hi! > Well, I don't see these warnings anymore, and don't see how they could happen, > however I still have some warnings: For getting this warnings you have to close anjuta while the latest session contains a vala file (and probably several other files) and then restart anjuta. Could be related to the threading issue mentioned below. > when I have a vala file open but is not the active document. The plugin is > activated then deactivated so fast that the thread I launch for parsing isn't > done yet. I could argue this is a bug in the language manager. And No, you can't. The document-manager does the right thing in loading and unloading the plugin and it can happen that the user switches tabs fast too. You have to make sure to catch the case when the thread isn't finished when the plugin is unloaded. > (anjuta:2097): language-support-vala-CRITICAL **: vala_plugin_lookup_symbol: > assertion `block != NULL' failed > > when I try to type outside of a code block (e.g. declaring a field). I'll leave > this until I find a better way to complete in these situations. I would prefer it that would end-up in a DEBUG_PRINT() saying "TODO: code completion outside blocks". Because the usual way of finding bugs is to run anjuta with --g-fatal-warnigs which will make it crash on every critical. As such, criticals should only appear at places where we really made a mistake. > > Here I mean the five settings on the autocompletion page. > Done :-) Thanks!
Created attachment 167576 [details] [review] libanjuta: fix declaration of anjuta_preferences_get_bool_with_default use gboolean instead of gint for booleans
Created attachment 167577 [details] [review] language-support-vala: update VAPI for libanjuta Sadly using the GIR is still not an option
Created attachment 167578 [details] [review] language-support-vala: use code completion preferences from -cpp-java
Hi! > Sadly using the GIR is still not an option Is this due to limitations of the vala compiler, wrong/missing introspection comments or due to non-introspectable APIs? Thanks for the patches, will have a look at them soon.
Review of attachment 167578 [details] [review]: Looks good! ::: plugins/language-support-cpp-java/anjuta-language-cpp-java.ui @@ -386,3 @@ <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes">Autocompletion (C/C++/Java only)</property> Good catch! I though I had to fix that manually myself :)
Review of attachment 167576 [details] [review]: Good point! No idea why I missed that one! Thanks!
(In reply to comment #16) > Hi! > > > Sadly using the GIR is still not an option > > Is this due to limitations of the vala compiler, wrong/missing introspection > comments or due to non-introspectable APIs? A limitation in vala. It doesn't handle typedefs to non-value-types. This means reference types (which are used in libanjuta for GNode and GTypeModule) and pointer types (IAnjutaBuilderHandle is a void*).
Created attachment 168070 [details] [review] language-support-vala: fix a critical warning and a memory leak
with the last patch, I don't see any more criticals when switching between vala and non-vala document. There is still a delay, I'm trying to find a way to fix it (using GCancellable) without requiring new API in vala.
Looks really good - thanks for all the patches and sorry for not applying the other two before the release, I simply forgot about it. Feel free to open another bug for the async stuff - I am closing this one.
It seems you forgot the last patch (attachment 168070 [details] [review])
Sorry...