Commit c00fd548 authored by Ben's avatar Ben
Browse files

create a dbus worker

parent 8be37487
......@@ -115,6 +115,7 @@ G_BEGIN_DECLS
#include "ide-workbench.h"
#include "ide-workbench-addin.h"
#include "ide-workbench-header-bar.h"
#include "ide-worker.h"
#include "editor/ide-editor-perspective.h"
#include "editor/ide-editor-view.h"
......
......@@ -19,6 +19,7 @@ libvala_pack_plugin_la_SOURCES = \
ide-vala-source-file.vala \
ide-vala-symbol-resolver.vala \
ide-vala-symbol-tree.vala \
ide-vala-worker.vala \
vala-pack-plugin.vala \
$(NULL)
......
......@@ -124,7 +124,7 @@ namespace Ide
return false;
}
if (Ide.CompletionProvider.context_in_comment (context))
if (Ide.CompletionProvider.context_in_comment_or_string (context))
return false;
return true;
......
......@@ -93,6 +93,10 @@ namespace Ide
/* TODO: find packages from build system */
this.code_context.add_external_package ("gio-2.0");
this.code_context.add_external_package ("gtk+-3.0");
this.code_context.add_external_package ("gtksourceview-3.0");
this.code_context.add_external_package ("libide-1.0");
this.code_context.add_external_package ("libpeas-1.0");
this.code_context.add_external_package ("libvala-0.32");
this.report = new Ide.ValaDiagnostics ();
this.code_context.report = this.report;
......
namespace Ide {
[DBus (name="org.gnome.builder.plugin.vala-pack")] // dbus interface name
public class ValaDBusService : Object {
}
[DBus (name="org.gnome.builder.plugin.vala-pack")] // dbus interface name
public interface ValaDBusClient : Object {
}
public class ValaWorker : Object, Ide.Worker {
public DBusProxy create_proxy (DBusConnection conn) throws IOError {
ValaDBusClient client = conn.get_proxy_sync (
null, // bus name
"/",
DBusProxyFlags.DO_NOT_LOAD_PROPERTIES |
DBusProxyFlags.DO_NOT_CONNECT_SIGNALS |
DBusProxyFlags.DO_NOT_AUTO_START_AT_CONSTRUCTION,
null);
return client as DBusProxy;
}
public void register_service (DBusConnection conn) {
try {
conn.register_object ("/", new ValaDBusService ());
} catch (IOError err) {
critical ("Could not register ValaDBusService object: %s",
err.message);
}
}
}
}
......@@ -25,6 +25,7 @@ public void peas_register_types (GLib.TypeModule module)
{
Peas.ObjectModule peas = (Peas.ObjectModule)module;
peas.register_extension_type (typeof (Ide.Worker), typeof (Ide.ValaWorker));
peas.register_extension_type (typeof (Ide.CompletionProvider), typeof (Ide.ValaCompletionProvider));
peas.register_extension_type (typeof (Ide.DiagnosticProvider), typeof (Ide.ValaDiagnosticProvider));
peas.register_extension_type (typeof (Ide.Indenter), typeof (Ide.ValaIndenter));
......
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