Vim Python omni-completion not working on system modules

I notice that even for system modules, code completion doesn't work too well.

For example, if I have a simple file that does:

import re
p = re.compile(pattern)
m = p.search(line)

      

If I type p., I don't get completion for the methods I would expect to see (for example, I don't see search (), but I see others like func_closure (), func_code ()).

If I find m., I don't get any completion, whatever it ever was (I would expect .groups (), in this case).

This does not affect all modules. Has anyone seen this behavior and knows how to fix it?

I am running Vim 7.2 on WinXP, with the latest pythoncomplete.vim from vim.org (0.9), running python 2.6.2.

+2


source to share


2 answers


Completing this kind of thing is tricky because it will need to execute the actual code for it to work.

For example, p.search () can return None or MatchObject, depending on the data passed to it.



This is why omni-completion doesn't work here, and probably never will. It works for things that can be statically defined, like the contents of a module.

+2


source


I've never gotten the built-in omnicomplete to work in any languages. I've had the most success with pysmell (which seems to have been recently updated on github than the official repo). I still haven't found it reliable enough to use it consistently, but I can't remember exactly why.



I have resorted to building an extensive set of snipMate snippets for my core libraries and using the default addon for the addon .

0


source







All Articles