add intellisense
see https://codemirror.net/demo/complete.html also take a look at https://github.com/BayardRock/WebIntellisense
another thing to take a look at: https://github.com/davidhalter/jedi
Jedi seems like the best python intellisense availible. Unfortunately it would be rather difficult to integrate. I'd have to do something like below:
python jedi -> pyshell -> JS jedi interface -> codemirror integration
There is no generic JS interface for jedi, altough there are some (undocumented) examples of it's use with vscode & atom
https://github.com/DonJayamanne/pythonVSCode/blob/master/src/client/jedi
https://github.com/brennv/autocomplete-python-jedi
I've also thought about doing "live" intellisense by using python's dir() and inspectdoc but that would be problematic when side-effects come to play. If someone was doing autocompletion on subtractFooByOne().fo .... then I would have to store the result of the method call in a temporary variable to avoid evaluating it twice. That could get really complicated.
I tried out "live" intellisense in #44:
When the user does control-enter I wrap the line in a print(dir()). If the line assigns to a variable then I do print(dir(var)) instead on the next line.
But there are tons of cases where this won't work - for example, wrapping if(var.) would result in a syntax error. What I really need is a parser to extract the variable. Or maybe I could use codemirror's inbuilt python parsing? Last time I checked it didn't tokenize everything though.