Permalink
Browse files

Added complete method of JS kernel object.

  • Loading branch information...
1 parent 00dc27f commit 5829983263257b354ee60ff76eef487d90baf0ee @ellisonbg ellisonbg committed Jul 26, 2011
@@ -67,6 +67,18 @@ var IPython = (function (IPython) {
}
+ Kernel.prototype.complete = function (line, cursor_pos) {
+ var content = {
+ text : '',
+ line : line,
+ cursor_pos : cursor_pos
+ };
+ var msg = this.get_msg("complete_request", content);
+ this.shell_channel.send(JSON.stringify(msg));
+ return msg.header.msg_id;
+ }
+
+
Kernel.prototype.interrupt = function () {
$.post(this.kernel_url + "/interrupt");
};
@@ -402,9 +402,11 @@ var IPython = (function (IPython) {
var cell = this.cell_for_msg(reply.parent_header.msg_id);
if (msg_type === "execute_reply") {
cell.set_input_prompt(content.execution_count);
+ } else if (msg_type === "complete_reply") {
+ console.log(content);
};
var payload = content.payload || [];
- this.handle_payload(content.payload);
+ this.handle_payload(payload);
};

0 comments on commit 5829983

Please sign in to comment.