<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 19, 2015 at 8:38 PM, Matthias Bussonnier <span dir="ltr"><<a href="mailto:bussonniermatthias@gmail.com" target="_blank">bussonniermatthias@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Le 19 févr. 2015 à 09:54, Thomas Kluyver <<a href="mailto:takowl@gmail.com">takowl@gmail.com</a>> a écrit :<br>
<span class=""><br>
><br>
> I think previously there was a regex in the JS that looked backwards for something like "name(". As part of the work to make the frontend more language agnostic, this was dropped - it now sends the current cell and the cursor position to the kernel and expects that to work out what it should provide information about.<br>
<br>
</span>Indeed,and having a space after the comma, or not was returning different results.<br>
<span class=""><br>
<br>
> The upside of this is that it's possible to do smarter things, like tokenising the code, so in your example:<br>
><br>
> > func1(a, func2(b), [shift-TAB]<br>
><br>
> it would be able to provide information on func1 rather than func2.<br>
><br>
> The downside is that we haven't implemented anything smart in the kernel yet, so it currently just gets the last name before or at the cursor.<br>
<br>
</span>You can also select and shift-tab, it should give info only on selection.<br>
<span class=""><br>
><br>
> We don't want to start messing around with this code for 3.0 now, but for 3.1 we should aim to make it at least as smart as the JS was in IPython 2.x. I'll open an issue for it.<br>
<br>
</span>It was not technically "smart", and we don't use the new message spec at all,<br>
so I doubt this will be a simple "fix".<br></blockquote><div><br></div><div>I don't know what you mean by "we don't use the new message spec", but the tokenization is done entirely on the Python side with the new message spec that we use in 3.0. Right now, the IPython kernel picks the nearest token to the cursor, but we could certainly change this to pick the most recent token before an open-paren if there is one. We just need to make a decision about what token should be inspected for a given context. I think that's a relatively challenging problem, since it's guessing user intent, but implementation shouldn't be the biggest challenge.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
--<br>
</font></span><div class="HOEnZb"><div class="h5">M<br>
<br>
<br>
> Thomas<br>
> _______________________________________________<br>
> IPython-dev mailing list<br>
> <a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
> <a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br>
_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
</div></div></blockquote></div><br></div></div>