[gnome-builder] vala: don't check code if we have errors



commit ca10d54a12d77915009ee7ffce9445bd9208b723
Author: Ben Iofel <iofelben gmail com>
Date:   Thu Mar 24 02:38:59 2016 -0400

    vala: don't check code if we have errors

 plugins/vala-pack/ide-vala-index.vala |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/plugins/vala-pack/ide-vala-index.vala b/plugins/vala-pack/ide-vala-index.vala
index 4d9225c..73b88d6 100644
--- a/plugins/vala-pack/ide-vala-index.vala
+++ b/plugins/vala-pack/ide-vala-index.vala
@@ -161,8 +161,12 @@ namespace Ide
                                                        this.add_file (file);
 
                                                this.apply_unsaved_files (unsaved_files_copy);
+                                               this.report.clear ();
                                                this.reparse ();
-                                               this.code_context.check ();
+                                               if (this.report.get_errors () == 0 &&
+                                                       (cancellable == null || !cancellable.is_cancelled 
())) {
+                                                   this.code_context.check ();
+                                               }
 
                                                GLib.Idle.add(this.parse_file.callback);
 
@@ -194,8 +198,12 @@ namespace Ide
                                        Vala.CodeContext.push (this.code_context);
 
                                        this.apply_unsaved_files (unsaved_files_copy);
+                                       this.report.clear ();
                                        this.reparse ();
-                                       this.code_context.check ();
+                                       if (this.report.get_errors () == 0 &&
+                                               (cancellable == null || !cancellable.is_cancelled ())) {
+                                           this.code_context.check ();
+                                       }
 
                                        if (this.source_files.contains (file)) {
                                                var source_file = this.source_files [file];


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]