I don't think this can be solved. The completion relies on parsing the
file by Python, thus when parsing fails somehow it doesn't know what to
complete.
Aaron, is there something that can be done to avoid this problem?
--
Lawmakers made it obligatory for everybody to take at least one bath
each week -- on Saturday night.
[real standing law in Vermont, United States of America]
/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
To add additional information on this omni-completion bug, I
discovered that this bug only affects omni-completion when editing the
file doing the failed import. For example take these two files:
--
#!/usr/bin/env python
# foo.py
import notamodule
class Foo:
def bar(self):
pass
# Can't do an omni-complete against Foo here
--
#!/usr/bin/env python
# spam.py
import foo
# You can, however, omni-complete foo.Foo here, even foo.Foo.bar
--
I'm not sure if this helps but it seemed worth reporting.
Best,
Chris
I'm confident that simply wrapping the imports in try blocks (in
pythoncomplete.vim) should solve this just fine.
More to the point, however - why are you running into a case like
this? Shouldn't you have a try block around imports that you expect to
fail?