Repository navigation
Conversation
|
Adding completion to the cell magic would require ipython/ipython#10722 |
|
...or I can monkey-patch IPython 😛 https://github.com/tkf/ipyjulia_hacks |
| """Load the extension in IPython.""" | ||
| ip.register_magics(JuliaMagics) | ||
| ip.set_hook("complete_command", julia_completer, | ||
| re_key="%?%julia") |
There was a problem hiding this comment.
As it does not work with cell magic, just use str_key="%julia".
| return String[] | ||
| end | ||
| end | ||
| """)(julia_code, julia_pos) |
There was a problem hiding this comment.
should we eval this function once and cache it?
There was a problem hiding this comment.
Yes. I use cached_property in my ipyjulia_hacks. Something like this can be done here. https://github.com/tkf/ipyjulia_hacks/blob/679f6bbd3ed202cde6ec6ebb4b1b537566531cdf/src/ipyjulia_hacks/completers.py#L19
But could you review #190 first? I think that's more fundamental and important. But that PR, in turn, depends on #188.
Pull Request Test Coverage Report for Build 476
💛 - Coveralls |
|
@Carreau, do you have a sense of what the best approach here is for cell magic? |
|
Well, tab completion and monkey patching seem like a good approach for now. refactoring, improving and getting for improving completion is in my goals. I don't have anything short term solution though. |
|
@Carreau Can't wait to see ipython/ipython#10722 (or similar mechanism) arrive on IPython master! @stevengj Do you want the monkey-patch in this PR? This is how I did it: |
(To be rebased after #190)