Skip to content

Commit

Permalink
refs #22 : modify - support newer continue / input mode
Browse files Browse the repository at this point in the history
  • Loading branch information
inureyes committed Dec 20, 2017
1 parent e7f6852 commit 874079c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/backend-ai-api-v3.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ export default class SornaAPILib {
return requestInfo;
}

runCode(code, kernelId, runId) {
runCode(code, kernelId, runId, mode) {
let requestBody = {
"mode": "query",
"mode": mode,
"code": code,
"runId": runId
};
Expand Down Expand Up @@ -157,4 +157,4 @@ export default class SornaAPILib {
let k2 = this.sign(k1, 'binary', this.endpoint, 'binary');
return k2;
}
}
}
5 changes: 4 additions & 1 deletion lib/live-code-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,18 +296,21 @@ export default AtomLiveCodeRunner = {
}
this.resultPanel.show();
let msg = "Running...";
let mode = "query";
if (this.waiting_input === true) {
console.debug("Waiting input...");
mode = "input";
} else if (this.continuation === true) {
this.code = '';
mode = "continue";
} else {
this.AtomLiveCodeRunnerView.clearContent();
this.AtomLiveCodeRunnerView.addConsoleMessage(msg);
let editor = atom.workspace.getActiveTextEditor();
this.code = editor.getText();
this._exec_starts = new Date().getTime();
}
return this.SornaAPILib.runCode(this.code, this.kernelId, this.runId)
return this.SornaAPILib.runCode(this.code, this.kernelId, this.runId, mode)
.then( response => {
if (response.ok === false) {
errorMsg = `live-code-runner: ${response.statusText}`;
Expand Down

0 comments on commit 874079c

Please sign in to comment.