[IPython-dev] [ANN] IPython 3.0.0rc1

Min RK benjaminrk at gmail.com
Fri Feb 20 08:56:45 EST 2015



> On Feb 19, 2015, at 23:23, Matthias Bussonnier <bussonniermatthias at gmail.com> wrote:
> 
> 
>> Le 19 févr. 2015 à 12:13, MinRK <benjaminrk at gmail.com> a écrit :
>> 
>> 
>> 
>>> On Thu, Feb 19, 2015 at 8:38 PM, Matthias Bussonnier <bussonniermatthias at gmail.com> wrote:
>>> 
>>> Le 19 févr. 2015 à 09:54, Thomas Kluyver <takowl at gmail.com> a écrit :
>>> 
>>> >
>>> > 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.
>>> 
>>> Indeed,and having a space after the comma, or not was returning different results.
>>> 
>>> 
>>> > The upside of this is that it's possible to do smarter things, like tokenising the code, so in your example:
>>> >
>>> > > func1(a, func2(b), [shift-TAB]
>>> >
>>> > it would be able to provide information on func1 rather than func2.
>>> >
>>> > 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.
>>> 
>>> You can also select and shift-tab, it should give info only on selection.
>>> 
>>> >
>>> > 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.
>>> 
>>> It was not technically "smart", and we don't use the new message spec at all,
>>> so I doubt this will be a simple "fix".
>> 
>> I don't know what you mean by "we don't use the new message spec",
> 
> Sorry ment we don't do smart completion on the full text of the cell. 
> 
>> 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.
> 
> That means that custom completer do not get access to the full cell right ? 

Not at all. Finding the token for introspection (tooltip) and completion are completely separate processes. Both should get the complete cell. Because of how IPython's completion machinery works now, I believe we only pass the completer the current line, but I think we can fix whatever it was that prevented the completer from working when you pass it multiline content.

> 
> 
> 
>>  
>>> 
>>> --
>>> M
>>> 
>>> 
>>> > Thomas
>>> > _______________________________________________
>>> > IPython-dev mailing list
>>> > IPython-dev at scipy.org
>>> > http://mail.scipy.org/mailman/listinfo/ipython-dev
>>> 
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev at scipy.org
>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>> 
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
> 
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150220/e0c9e441/attachment.html>


More information about the IPython-dev mailing list