editor code completion

2010-07-21
2013-03-15
  • Joost Rekveld
    Joost Rekveld
    2010-07-21

    Hi all,

    I'm probably missing something very obvious but there is something which I don't understand:

    if I have 'import numpy as np' in my module, I get all kinds of great code completion-suggestions in the editor after I type 'np.'
    If I have 'import pyopencv as cv' in my module, the same does not happen after I type 'cv.'
    If I do the same in a PyDev console, it works in both cases, and I added pyopencv as a forced builtin, so that is not it.

    What am I missing here ? How can I also have code completion for pyopencv ?

    thanks,

    Joost.

     
  • Joost Rekveld
    Joost Rekveld
    2010-07-22

    Yes, i did, that's why I don't understand…

    Don't get why it works in the console but not in the editor.

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2010-07-23

    I just tested it here and it just worked (without even adding to the forced builtins). I believe your problem is that the interpreter is not up-to-date with your installation. Try removing and then adding again the interpreter and see if it works.

    Cheers,

    Fabio

     
  • Joost Rekveld
    Joost Rekveld
    2010-08-21

    Hi Fabio,

    thanks, that worked. I'd like to understand better what's happening here, though. Does it have to do with me having installed plenty python packages (which should normally be dealt with by refreshing the pythonpath, no ?) or is it related to my python version perhaps having been updated or something ?

    What is annoying now, however, is that in the editor, if I type "cv." it takes about 10 seconds for the completions to appear (shorter if I type "cv.V" for example), whereas in the case of "np." it is nice and snappy. In the pydev console, typing "cv." results in snappy completions too. Is there something I can do about this ?

    thanks,

    Joost.

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2010-08-22

    Every time you install a new python package that's bound to interpreter (as opposed to a project), you have to re-apply your interpreter configuration (sometimes even if the pythonpath didn't change - as is the case of adding a new library in the site-packages).

    As for the 'cv.' completion taking a lot of time, does that happen only the first time or any time you request it? Is it in the 'forced builtins' or not? If only in the first time it may be because that's the time when a number of caches are built (if always, I'd have to investigate, but it can probably be made faster in that case).

    Cheers,

    Fabio

     
  • Joost Rekveld
    Joost Rekveld
    2010-08-23

    Thanks for the explanation, one day I will understand what you mean (I'm not kidding or cynical but on a learning curve here..).

    The cv.-codecompletion took a lot of time always, but now I added it to the forced builtins so it thinks a bit the first time and is very NICE and snappy after that. Great !!

    thanks a lot (again !),
    ciao,

    Joost.