Commit eeabbd37 authored by Christian Hergert's avatar Christian Hergert
Browse files

Revert "vala: work around Vala language breaks"

This reverts commit edc8381c.
parent 7e5d1d19
......@@ -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; }
}
}
......@@ -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; }
}
}
......@@ -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; }
}
}
......@@ -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; }
}
}
......@@ -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;
}
}
}
......@@ -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; }
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment