[gnome-builder] Revert "vala: work around Vala language breaks"



commit eeabbd37cee66b0a454604ab730f252af94eb09b
Author: Christian Hergert <chergert redhat com>
Date:   Fri Mar 10 18:57:46 2017 -0800

    Revert "vala: work around Vala language breaks"
    
    This reverts commit edc8381c1fe2f904f5dce10f74876cb100fe42e9.

 .../vala-pack/ide-vala-completion-provider.vala    |   13 +++----------
 .../vala-pack/ide-vala-diagnostic-provider.vala    |   14 ++++----------
 plugins/vala-pack/ide-vala-indenter.vala           |    9 +--------
 plugins/vala-pack/ide-vala-pipeline-addin.vala     |    9 +--------
 plugins/vala-pack/ide-vala-service.vala            |   19 +++----------------
 plugins/vala-pack/ide-vala-symbol-resolver.vala    |   13 +++----------
 6 files changed, 15 insertions(+), 62 deletions(-)
---
diff --git a/plugins/vala-pack/ide-vala-completion-provider.vala 
b/plugins/vala-pack/ide-vala-completion-provider.vala
index 3fef3cf..234cb33 100644
--- a/plugins/vala-pack/ide-vala-completion-provider.vala
+++ b/plugins/vala-pack/ide-vala-completion-provider.vala
@@ -22,7 +22,7 @@ using Vala;
 
 namespace Ide
 {
-       public class ValaCompletionProvider: GLib.Object,
+       public class ValaCompletionProvider: Ide.Object,
                                             Gtk.SourceCompletionProvider,
                                             Ide.CompletionProvider
        {
@@ -75,9 +75,9 @@ namespace Ide
 
                        buffer.sync_to_unsaved_files ();
 
-                       var service = (this._context.get_service_typed (typeof (Ide.ValaService)) as 
Ide.ValaService);
+                       var service = (this.get_context ().get_service_typed (typeof (Ide.ValaService)) as 
Ide.ValaService);
                        var index = service.index;
-                       var unsaved_files = this._context.get_unsaved_files ();
+                       var unsaved_files = this.get_context ().get_unsaved_files ();
 
                        var cancellable = new GLib.Cancellable ();
                        context.cancelled.connect(() => {
@@ -147,12 +147,5 @@ namespace Ide
                }
 
                public void load () {}
-
-               // This code shouldn't have to exist.
-               // If we can fixup libide+vala to not have such weird interaction that
-               // would be great.
-               Ide.Context? _context;
-               public Ide.Context context { construct { _context = value; } }
-               public void set_context (Ide.Context context) { _context = context; }
        }
 }
diff --git a/plugins/vala-pack/ide-vala-diagnostic-provider.vala 
b/plugins/vala-pack/ide-vala-diagnostic-provider.vala
index 4033294..03886ce 100644
--- a/plugins/vala-pack/ide-vala-diagnostic-provider.vala
+++ b/plugins/vala-pack/ide-vala-diagnostic-provider.vala
@@ -22,26 +22,20 @@ using Vala;
 
 namespace Ide
 {
-       public class ValaDiagnosticProvider: GLib.Object, Ide.DiagnosticProvider
+       public class ValaDiagnosticProvider: Ide.Object, Ide.DiagnosticProvider
        {
                public async Ide.Diagnostics? diagnose_async (Ide.File file,
                                                              Ide.Buffer buffer,
                                                              GLib.Cancellable? cancellable)
                        throws GLib.Error
                {
-                       var service = (Ide.ValaService)_context.get_service_typed (typeof (Ide.ValaService));
-                       yield service.index.parse_file (file.file, _context.unsaved_files, cancellable);
+                       var context = this.get_context ();
+                       var service = (Ide.ValaService)context.get_service_typed (typeof (Ide.ValaService));
+                       yield service.index.parse_file (file.file, context.unsaved_files, cancellable);
                        var results = yield service.index.get_diagnostics (file.file, cancellable);
                        return results;
                }
 
                public void load () {}
-
-               // This code shouldn't have to exist.
-               // If we can fixup libide+vala to not have such weird interaction that
-               // would be great.
-               Ide.Context? _context;
-               public Ide.Context context { construct { _context = value; } }
-               public void set_context (Ide.Context context) { _context = context; }
        }
 }
diff --git a/plugins/vala-pack/ide-vala-indenter.vala b/plugins/vala-pack/ide-vala-indenter.vala
index cd812ce..95e29d5 100644
--- a/plugins/vala-pack/ide-vala-indenter.vala
+++ b/plugins/vala-pack/ide-vala-indenter.vala
@@ -21,7 +21,7 @@ using Ide;
 
 namespace Ide
 {
-       public class ValaIndenter: GLib.Object, Ide.Indenter
+       public class ValaIndenter: Ide.Object, Ide.Indenter
        {
                public bool is_trigger (Gdk.EventKey evkey)
                {
@@ -180,12 +180,5 @@ namespace Ide
 
                        return (prev.get_char () == '{') && (iter.get_char () == '\n') && (next.get_char () 
== '}');
                }
-
-               // This code shouldn't have to exist.
-               // If we can fixup libide+vala to not have such weird interaction that
-               // would be great.
-               Ide.Context? _context;
-               public Ide.Context context { construct { _context = value; } }
-               public void set_context (Ide.Context context) { _context = context; }
        }
 }
diff --git a/plugins/vala-pack/ide-vala-pipeline-addin.vala b/plugins/vala-pack/ide-vala-pipeline-addin.vala
index 03daab7..3626ca6 100644
--- a/plugins/vala-pack/ide-vala-pipeline-addin.vala
+++ b/plugins/vala-pack/ide-vala-pipeline-addin.vala
@@ -23,7 +23,7 @@ using Vala;
 
 namespace Ide
 {
-       public class ValaPipelineAddin: GLib.Object, Ide.BuildPipelineAddin
+       public class ValaPipelineAddin: Ide.Object, Ide.BuildPipelineAddin
        {
                // main.vala:24.30-24.30: error: initializer list used for `Gtk.WindowType', which is neither 
array nor struct
                const string ERROR_FORMAT_REGEX =
@@ -44,12 +44,5 @@ namespace Ide
                {
                        pipeline.remove_error_format (this.error_format);
                }
-
-               // This code shouldn't have to exist.
-               // If we can fixup libide+vala to not have such weird interaction that
-               // would be great.
-               Ide.Context? _context;
-               public Ide.Context context { construct { _context = value; } }
-               public void set_context (Ide.Context context) { _context = context; }
        }
 }
diff --git a/plugins/vala-pack/ide-vala-service.vala b/plugins/vala-pack/ide-vala-service.vala
index e6ab84f..51c7d56 100644
--- a/plugins/vala-pack/ide-vala-service.vala
+++ b/plugins/vala-pack/ide-vala-service.vala
@@ -22,10 +22,9 @@ using Vala;
 
 namespace Ide
 {
-       public class ValaService: GLib.Object, Ide.Service
+       public class ValaService: Ide.Object, Ide.Service
        {
                Ide.ValaIndex _index;
-               Ide.Context? _context;
 
                construct {
                }
@@ -39,10 +38,10 @@ namespace Ide
                }
 
                public void start () {
-                       this._index = new Ide.ValaIndex (this._context);
+                       this._index = new Ide.ValaIndex (this.get_context ());
 
                        Ide.ThreadPool.push (Ide.ThreadPoolKind.INDEXER, () => {
-                               Ide.Vcs vcs = this._context.get_vcs ();
+                               Ide.Vcs vcs = this.get_context ().get_vcs ();
                                var files = new ArrayList<GLib.File> ();
 
                                load_directory (vcs.get_working_directory (), null, files);
@@ -85,17 +84,5 @@ namespace Ide
                                warning ("%s", err.message);
                        }
                }
-
-               // This code shouldn't have to exist.
-               // If we can fixup libide+vala to not have such weird interaction that
-               // would be great.
-
-               public Ide.Context context {
-                       construct { this._context = value; }
-               }
-
-               public void set_context (Ide.Context context) {
-                       this._context = context;
-               }
        }
 }
diff --git a/plugins/vala-pack/ide-vala-symbol-resolver.vala b/plugins/vala-pack/ide-vala-symbol-resolver.vala
index b7521fa..6f8501e 100644
--- a/plugins/vala-pack/ide-vala-symbol-resolver.vala
+++ b/plugins/vala-pack/ide-vala-symbol-resolver.vala
@@ -22,14 +22,14 @@ using Vala;
 
 namespace Ide
 {
-       public class ValaSymbolResolver: GLib.Object, Ide.SymbolResolver
+       public class ValaSymbolResolver: Ide.Object, Ide.SymbolResolver
        {
                public async Ide.SymbolTree? get_symbol_tree_async (GLib.File file,
                                                                    Ide.Buffer buffer,
                                                                    GLib.Cancellable? cancellable)
                        throws GLib.Error
                {
-                       var context = this._context;
+                       var context = this.get_context ();
                        var service = (Ide.ValaService)context.get_service_typed (typeof (Ide.ValaService));
                        var index = service.index;
                        var symbol_tree = yield index.get_symbol_tree (file, cancellable);
@@ -41,7 +41,7 @@ namespace Ide
                                                              GLib.Cancellable? cancellable)
                        throws GLib.Error
                {
-                       var context = this._context;
+                       var context = this.get_context ();
                        var service = (Ide.ValaService)context.get_service_typed (typeof (Ide.ValaService));
                        var index = service.index;
                        var file = location.get_file ();
@@ -111,13 +111,6 @@ namespace Ide
                }
 
                public void load () {}
-
-               // This code shouldn't have to exist.
-               // If we can fixup libide+vala to not have such weird interaction that
-               // would be great.
-               Ide.Context? _context;
-               public Ide.Context context { construct { _context = value; } }
-               public void set_context (Ide.Context context) { _context = context; }
        }
 }
 


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