ActiveState Community

Code Completion

Posted by sune on 2009-10-28 15:20

Hi,

I've just started to use komodo again after a little break and I can't seem to get completion with Python to work like I would expect it to.

The python language completion is there, but the introspection/completion is really sparse. Komodo will not do completion for things like variables and function local to the file I'm working in, through I'm ctrl+j'ing away :-) Is there a setting I need to tweak?

Also I would like to know if there is a way to enable completion on the attributes of a module that is imported into the root namespace?

Lastly I posted about Komoodo not displaying the full text of python multipline docstring on call tips a while ago. Any news on that?

Thanks,
Sune

toddw | Wed, 2009-10-28 15:57

Komodo will not do completions for things like variables and function local to the file I'm working in
Ensure the codeintel preferences are enabled (enable automatic autocomplete ...).

Note that Komodo's Python code intelligence requires that the file be syntactically correct (no errors) before the code can be correctly scanned and used for completions. Also note that Komodo's Python completions only occur after a "." for most cases.

Enable completion on the attributes of a module that is imported into the root namespace
If you import a module (or it's contents) then Komodo will provide completions for those contents, example:

# completions shown at this point - where the | is the cursor
import |   
import os.|
from os import |
from os import path
path.|
# completions shown at this point - where the | is the cursor
import |   
import os.|
from os import |
from os import path
path.|

Komodo not displaying the full text of python multipline docstrings
No, Komodo does not show the full calltip. I had thought this was fixed - but it appears it hasn't been completely fixed. I found the following bug that was closed and re-opened it:
http://bugs.activestate.com/show_bug.cgi?id=81873

Cheers,
Todd

sune | Wed, 2009-10-28 16:12

Hi Todd,

Thanks a bunch. Just to be sure I'm getting this straight:

Is it: Preferences->code inteligence->"enable automatic autocomplete and calltip triggering while you type" that needs to be on? (Because it already is)

A co-worker, that also just started using Komodo again, says he remembers that there is a non default setting that you have to set, that will give you much more completion. But he's not been able to locate it..

About the completion, is it possible to make Komodo suggest more of the stuff that's before the '.'?

Thanks again,
Sune

toddw | Wed, 2009-10-28 16:19

Hey Sune,

Yes - that is the correct preference.

No - there are no (hidden) preferences to enable more code completion.

Komodo's Python completions does not trigger for variables/functions before the .(, but there is a request for it to trigger earlier (like PHP and JS does - after 3 characters), see:
http://bugs.activestate.com/show_bug.cgi?id=59937

Cheers,
Todd

sune | Thu, 2009-10-29 13:44

Oh, about the docstring being capped, I see that a "." might also do it.

So this:
This is the first part. This is the second part.

Will show as:
This is the first part.

Cheers,
Sune