ipykernel icon indicating copy to clipboard operation
ipykernel copied to clipboard

Autocomplete: Expose Jedi signature to frontends

Open lgeiger opened this issue 8 years ago • 3 comments

This adds support for function signatures introduced in https://github.com/ipython/ipython/pull/10507 so we can try them in other frontends.

/cc @Carreau

lgeiger avatar Jun 06 '17 13:06 lgeiger

Hey there @lgeiger. I'm going through old issues and it seems this one stalled.

I've just rebased and changed the generic 'signature' to a 'right_label' as per discussion above.

Do you still have cycles to push forward on this? Either way is fine, I think we just need to document the change before merging, so others can know they can start using this. So that would be the next step (unless, of course, I've missed something entirely and this has been superseded by another avenue of transmitting signatures).

ivanov avatar May 15 '21 21:05 ivanov

Python 3.9 test failed here, but in a weird timeout - so I'm just gonna try running it again.

ivanov avatar May 17 '21 06:05 ivanov

Note: LSP uses just label which includes both the name of the function and the arguments. I think that returning text + signature and calling it label is a more future-proof approach as compared to using right_label.

While LSP does use signature in other contexts, this is definitely a completion label; also thinking about other uses of completer which modify the already entered text which is already possible with IPython - e.g. the LaTeX symbols completions, pre-pending text on the left would not be unexpected for me. Think about a user trying to complete sqrt but they have not imported it but they have math available - in that case the label could be math.sqrt(x) (and the text would be math.sqrt with adjusted start/end coordinates). How does that sound?

Edit: Also, JupyterLab is ready to receive label (well, we will need to actually pass it, but the current interface does separate label from insertText so we can easily adopt the label from this PR).

krassowski avatar Sep 04 '21 22:09 krassowski