[IPython-dev] [ANN] IPython 3.0.0rc1
MinRK
benjaminrk at gmail.com
Thu Feb 19 15:17:55 EST 2015
On Thu, Feb 19, 2015 at 9:13 PM, MinRK <benjaminrk at gmail.com> wrote:
>
> 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", 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.
>
For example, here’s one implementation
<https://github.com/ipython/ipython/pull/7819>.
-MinRK
>
>>
>> --
>> 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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150219/73112764/attachment.html>
More information about the IPython-dev
mailing list