[Bf-committers] Text Editor - Auto Complete

Alex Fraser alex at phatcore.com
Sun Dec 12 10:15:49 CET 2010


On Sat, Dec 11, 2010 at 1:48 PM, Alex Fraser <alex at phatcore.com> wrote:
> we could generate predefined completion files for Pydev:
>
>    http://pydev.org/manual_101_interpreter.html#id2
>
> [...] it could be generated using introspection from a running game.

Here is a game that does that:

    http://www.pasteall.org/blend/4441

Just run the game; it will generate a bunch of .pypredef files in the
current directory, like this one:

    http://www.pasteall.org/17538/python

Add that directory to the predefined completions tab in Pydev, and
code completion should just work. One caveat: I found that I have to
do my imports like this:

    from bge import logic

Because Pydev won't recognise "bge.logic.getCurrentScene".

I hope this is helpful to someone.
Alex


More information about the Bf-committers mailing list