Commit 08fdce45 authored by Romain Casati's avatar Romain Casati

Completion support.

parent fcdf20b0
......@@ -303,5 +303,15 @@
}
};
/**
* Complete a code at the end (usefull for tab completion).
*
* Returns an array of two elements: the list of completions
* and the start index.
*/
that.complete = function (code) {
return pyodide.globals.basthon.kernel.complete(code);
}
return that;
}));
......@@ -133,3 +133,5 @@ def execution_count():
eval = _console.eval
complete = _console.complete
def test_completion(selenium):
assert selenium.run_js("return Basthon.complete('print.__d')") == [[
'print.__delattr__(',
'print.__dir__(',
'print.__doc__'], 0]
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