[Eric] extending the Editor

Detlev Offenbach detlev at die-offenbachs.de
Sun Sep 14 14:58:07 BST 2008


On Sonntag, 14. September 2008, Albert Zeyer wrote:
> Hi,
>
> Am 13.09.2008 um 17:45 schrieb Detlev Offenbach:
> > On Samstag, 13. September 2008, Albert Zeyer wrote:
> >> Am 13.09.2008 um 16:59 schrieb Detlev Offenbach:
> >>> On Samstag, 13. September 2008, Albert Zeyer wrote:
> >>>> Hi,
> >>>>
> >>>> I am planning to extend the editor. I am thinking of some advanced
> >>>> autocompletion features that can be used while you develop the
> >>>> application.
> >>>
> >>> There is already an enhanced autocompletion provider around. It is
> >>> the eric4
> >>> Assistant plugin. Maybe that does what you are looking for.
> >>
> >> I tried that but it is not working correctly. I have the following
> >> example code:
> >>
> >>
> >> import sys
> >> import time
> >>
> >> x = 1
> >> while True:
> >> 	time.sleep(1)
> >> 	x = x + 1
> >> 	print "Hallo, x =", x
> >>
> >> And I tried to write "time." and I was expecting a calltip coming up.
> >> There was something coming up very fast but it closed immediatly
> >> again.
> >
> > Did you configure the APIs to be used correctly? (Configuration
> > Dialog,
> > Editor->APIs)
>
> No, thanks, I missed that. I added the Python 2.5 API now and it seems
> to work particulary.
>
> I can type "sys." now and it lists all the members of that module.
> Though, when I type "sys.stdout." for example, I does not list any
> members of the stdout stream.
>
> >> I have tried both the 1.0.2 and 1.1.0 of the Assistant plugin.
> >>
> >> It does work though in the Shell.
> >>
> >> Is the Assistant plugin only working in the Shell or should it also
> >> work in the editor?
> >
> > It only works in the editor. The shell uses it's own completion
> > provided by
> > the running python shell.
>
> Ah OK. It seems that the auto completion in the shell works better
> than in the editor. That is probably because the shell has all the
> runtime information about all objects. Can I use the same auto
> completion somehow in the code (while the application is running)?

Nope. The autocompletion available in the editor is somewhat limited to static 
information contained in the API files or the current document. The eric4 
Assistant plugin extends this to provide autocompletion for the current 
project as well. This is updated as soon as a file belonging to the project 
is safed. Having dynamic autocompletion like in the shell would mean to run 
an interpreter in the background executing the current code, which might lead 
to unwanted effects (like windows popping up).

Regards,
Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de


More information about the Eric mailing list