We're planning on using iPython and/or Jupyter notebooks for an interactive environment to interface with our DUT (device under test).
There will be classes created, etc. to interact with the DUT, but some of the functions take "many" parameters. I'd like to be able to help our users by enhancing tab-completion to:
DUT.< tab >
- shows all the commands available to send to the DUT, narrowing down, etc. based on previous typed letters
DUT.a < tab >
- shows all commands available that start with A
DUT.activate( < tab >
- shows options for first parameter, or potential keywords for **kwargs
DUT.activate( A< tab >
- shows options for first parameter or potential keywords for **kwargs that start with A
DUT.activate( 1, ACTUATOR=< tab >
- shows help for the **kwarg ACTUATOR, and potentially the name of enums it can take, etc.
I know this question is open ended, but google doesn't seem to find any examples on point or worse, doesn't say if it's the "right" way to do it or not. All of the keywords I can come up with don't really narrow down the search to anything on topic.
I've seen ipython.set_hook('complete_command',...)
, but I can't really find any documentation on it.
Honestly, I'd hope there was a way to decorate/document my classes so it could just be sucked up from the docstring, that would be the most awesome, but I can do that if I know how I'm supposed to hook into the tab completion.
Bonus points if I can get it to work under the standard intellisense stuff in VSCODE (so much of the behavior is available in both writing scripts and interactively).
Or am I being too ambitious here?