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

symbol-resolver: drop :context from the symbol resolver

We get this from IdeObject now, so we don't need to specify it in the
interface as long as we keep using ide_extension_new()/etc.

https://bugzilla.gnome.org/show_bug.cgi?id=779891
parent 3bb3e44c
......@@ -19,12 +19,12 @@
#define G_LOG_DOMAIN "ide-symbol-resolver"
#include "ide-context.h"
#include "buffers/ide-buffer.h"
#include "buffers/ide-buffer.h"
#include "files/ide-file.h"
#include "symbols/ide-symbol-resolver.h"
G_DEFINE_INTERFACE (IdeSymbolResolver, ide_symbol_resolver, G_TYPE_OBJECT)
G_DEFINE_INTERFACE (IdeSymbolResolver, ide_symbol_resolver, IDE_TYPE_OBJECT)
static void
ide_symbol_resolver_real_get_symbol_tree_async (IdeSymbolResolver *self,
......@@ -65,13 +65,6 @@ ide_symbol_resolver_default_init (IdeSymbolResolverInterface *iface)
{
iface->get_symbol_tree_async = ide_symbol_resolver_real_get_symbol_tree_async;
iface->get_symbol_tree_finish = ide_symbol_resolver_real_get_symbol_tree_finish;
g_object_interface_install_property (iface,
g_param_spec_object ("context",
"Context",
"Context",
IDE_TYPE_CONTEXT,
(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)));
}
/**
......
......@@ -26,7 +26,7 @@ G_BEGIN_DECLS
#define IDE_TYPE_SYMBOL_RESOLVER (ide_symbol_resolver_get_type())
G_DECLARE_INTERFACE (IdeSymbolResolver, ide_symbol_resolver, IDE, SYMBOL_RESOLVER, GObject)
G_DECLARE_INTERFACE (IdeSymbolResolver, ide_symbol_resolver, IDE, SYMBOL_RESOLVER, IdeObject)
struct _IdeSymbolResolverInterface
{
......@@ -50,10 +50,6 @@ struct _IdeSymbolResolverInterface
GAsyncResult *result,
GError **error);
void (*load) (IdeSymbolResolver *self);
/* Pacify vala, ideally we wouldn't have this vfunc */
void (*set_context) (IdeSymbolResolver *self,
IdeContext *context);
};
void ide_symbol_resolver_load (IdeSymbolResolver *self);
......
......@@ -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; }
}
}
Markdown is supported
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