Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More introspection of code submitted to complete_request #154

Open
afshin opened this issue Jul 8, 2016 · 3 comments
Open

More introspection of code submitted to complete_request #154

afshin opened this issue Jul 8, 2016 · 3 comments

Comments

@afshin
Copy link
Member

afshin commented Jul 8, 2016

The kernel API function for completion requests (complete_request) does not specify the level of completeness (no pun intended) a client can expect for a certain input. For example, consider the following code:

from ipywidgets import HTML
from IPython.display import display
h = HTML("<div>Hello!</div>")
h.
display(h)

Suppose I hit at the end of the fourth line, the API response will not contain any completion matches. But the kernel does actually have enough information to import and load HTML and make its instance methods and attributes available. This is how many IDEs work.

I'd like to request this level of completion be added. It would be a non-breaking update with no API ramifications, and it wouldn't necessarily be an imposition on other kernel authors (though it may encourage them to update their kernels, too).

cc: @ellisonbg @fperez @Carreau

@minrk
Copy link
Member

minrk commented Jul 8, 2016

You are right that this is fully within the message spec, and purely a behavior choice that IPython can make. IPython already has the notion of "greedy completion", allowing evaluation of the leading part of the current expression prior to evaluating the completion, which can sensibly be extended to the rest of the cell, as well. It's off by default, because it can result in undesirable side effects on completion. I think it may take some of the post-readline cleanup of the completion machinery to get this particular feature in, as there are several places remaining where the readline model is still baked in to IPython's completions.

@blink1073
Copy link
Contributor

This would naturally be picked up if using a jedi based completer.

@Carreau
Copy link
Member

Carreau commented Jul 8, 2016

I've started to push @michaelpacer on this task Wednesday [you can meet at SciPy]. Note that we briefly had Jedi completion during 5.0 cycle, so this kind of things used to work, but we rolled back because of bugs.

This is tracked as part of ipython/ipython#9477

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants