Added complete method of JS kernel object.

pull/37/head
Brian Granger 15 years ago
parent f24bd4f635
commit e09906c1a8

@ -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);
};

Loading…
Cancel
Save