GNOME Bugzilla – Bug 791936
ide-vala-index.vala is broken because of recent vala parser update
Last modified: 2018-01-11 10:52:41 UTC
This is the related vala update. commit 2dc47785171f8f62f7f017939681e0d5cf3e9847 Author: Rico Tzschichholz <ricotz@ubuntu.com> Date: Thu Dec 14 10:23:14 2017 +0100 Release taken references to CodeContext after using it https://bugzilla.gnome.org/show_bug.cgi?id=712694 --- vala/valaparser.vala | 1 + 1 file changed, 1 insertion(+) diff --git a/vala/valaparser.vala b/vala/valaparser.vala index ec5e34e82..6228ba98e 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -76,6 +76,7 @@ public class Vala.Parser : CodeVisitor { public void parse (CodeContext context) { this.context = context; context.accept (this); + this.context = null; } public override void visit_source_file (SourceFile source_file) { We have these lines in ide-vala-index.vala public ValaIndex (Ide.Context context) { ... this.parser = new Vala.Parser (); this.parser.parse (this.code_context); ... } void reparse () { this.report.clear (); foreach (var source_file in this.code_context.get_source_files ()) { if (source_file.get_nodes ().size == 0) { this.parser.visit_source_file (source_file); if (source_file is Ide.ValaSourceFile) { (source_file as Ide.ValaSourceFile).dirty = false; } } } } Vala.Parser.visit_source_files() tries to use Vala.CodeContext internally but it is set as null already. It shows messages like this and indexing job seems to fail. 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_code_context_get_run_output: assertion 'self != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_code_context_get_root: assertion 'self != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_parser_parse_using_directives: assertion 'ns != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_code_context_get_root: assertion 'self != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_parser_parse_declarations: assertion 'parent != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_code_context_get_run_output: assertion 'self != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_code_context_get_root: assertion 'self != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_parser_parse_using_directives: assertion 'ns != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_code_context_get_root: assertion 'self != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_parser_parse_declarations: assertion 'parent != NULL' failed
Rico, any thoughts on if there is a better way for us to handle this in Builder?
Created attachment 366037 [details] [review] parser: Allow custom invocations of parse_file() Use CodeContext of SourceFile if needed
Comment on attachment 366037 [details] [review] parser: Allow custom invocations of parse_file() Attachment 366037 [details] pushed as 71da3b8 - parser: Allow custom invocations of parse_file()
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-builder/issues/339.