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 626349 - polishing the vala plugin
polishing the vala plugin
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: language-support-vala
git master
Other Linux
: Normal normal
: ---
Assigned To: Abderrahim Kitouni
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2010-08-08 08:28 UTC by Abderrahim Kitouni
Modified: 2010-08-26 17:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
language-support-vala: better completion for local variables (1.54 KB, patch)
2010-08-08 08:31 UTC, Abderrahim Kitouni
committed Details | Review
language-support-vala: fix critical warnings if there are parsing errors (2.21 KB, patch)
2010-08-08 08:32 UTC, Abderrahim Kitouni
committed Details | Review
language-support-vala: remove remaining critical warnings (1.17 KB, patch)
2010-08-08 08:33 UTC, Abderrahim Kitouni
committed Details | Review
language-support-vala: correctly handle calltip showing for delegates (1.42 KB, patch)
2010-08-08 08:33 UTC, Abderrahim Kitouni
committed Details | Review
libanjuta: fix declaration of anjuta_preferences_get_bool_with_default (1.82 KB, patch)
2010-08-11 10:57 UTC, Abderrahim Kitouni
accepted-commit_now Details | Review
language-support-vala: update VAPI for libanjuta (32.20 KB, patch)
2010-08-11 10:59 UTC, Abderrahim Kitouni
none Details | Review
language-support-vala: use code completion preferences from -cpp-java (5.49 KB, patch)
2010-08-11 11:00 UTC, Abderrahim Kitouni
accepted-commit_now Details | Review
language-support-vala: fix a critical warning and a memory leak (1.32 KB, patch)
2010-08-17 13:22 UTC, Abderrahim Kitouni
none Details | Review

Description Abderrahim Kitouni 2010-08-08 08:28:25 UTC
See attached patches. Mainly removing critical warnings and fixing calltips for delegates.
Comment 1 Abderrahim Kitouni 2010-08-08 08:31:53 UTC
Created attachment 167352 [details] [review]
language-support-vala: better completion for local variables
Comment 2 Abderrahim Kitouni 2010-08-08 08:32:58 UTC
Created attachment 167353 [details] [review]
language-support-vala: fix critical warnings if there are parsing errors
Comment 3 Abderrahim Kitouni 2010-08-08 08:33:19 UTC
Created attachment 167354 [details] [review]
language-support-vala: remove remaining critical warnings
Comment 4 Abderrahim Kitouni 2010-08-08 08:33:33 UTC
Created attachment 167355 [details] [review]
language-support-vala: correctly handle calltip showing for delegates
Comment 5 Johannes Schmid 2010-08-08 08:59:53 UTC
Review of attachment 167352 [details] [review]:

Thanks!
Comment 6 Johannes Schmid 2010-08-08 09:00:08 UTC
Review of attachment 167353 [details] [review]:

Thanks!
Comment 7 Johannes Schmid 2010-08-08 09:00:23 UTC
Review of attachment 167354 [details] [review]:

Thanks!
Comment 8 Johannes Schmid 2010-08-08 09:00:54 UTC
Review of attachment 167355 [details] [review]:

Thanks!
Comment 9 Johannes Schmid 2010-08-08 09:01:13 UTC
Review of attachment 167355 [details] [review]:

Thanks!
Comment 10 Johannes Schmid 2010-08-08 09:03:36 UTC
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!
Comment 11 Abderrahim Kitouni 2010-08-11 10:15:30 UTC
(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 :-)
Comment 12 Johannes Schmid 2010-08-11 10:39:22 UTC
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!
Comment 13 Abderrahim Kitouni 2010-08-11 10:57:23 UTC
Created attachment 167576 [details] [review]
libanjuta: fix declaration of anjuta_preferences_get_bool_with_default

use gboolean instead of gint for booleans
Comment 14 Abderrahim Kitouni 2010-08-11 10:59:20 UTC
Created attachment 167577 [details] [review]
language-support-vala: update VAPI for libanjuta

Sadly using the GIR is still not an option
Comment 15 Abderrahim Kitouni 2010-08-11 11:00:06 UTC
Created attachment 167578 [details] [review]
language-support-vala: use code completion preferences from -cpp-java
Comment 16 Johannes Schmid 2010-08-11 11:51:06 UTC
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.
Comment 17 Johannes Schmid 2010-08-11 11:57:00 UTC
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 :)
Comment 18 Johannes Schmid 2010-08-11 11:57:30 UTC
Review of attachment 167576 [details] [review]:

Good point! No idea why I missed that one!

Thanks!
Comment 19 Abderrahim Kitouni 2010-08-11 13:42:56 UTC
(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*).
Comment 20 Abderrahim Kitouni 2010-08-17 13:22:44 UTC
Created attachment 168070 [details] [review]
language-support-vala: fix a critical warning and a memory leak
Comment 21 Abderrahim Kitouni 2010-08-17 13:31:08 UTC
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.
Comment 22 Johannes Schmid 2010-08-17 17:47:27 UTC
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.
Comment 23 Abderrahim Kitouni 2010-08-26 09:30:49 UTC
It seems you forgot the last patch (attachment 168070 [details] [review])
Comment 24 Johannes Schmid 2010-08-26 17:11:00 UTC
Sorry...