Vim's omnicompletion fails with “from” imports in Python?

Update: ooh, so I checked your example, and I get completion for x = Test() x. But this from StringIO import StringIO class M: pass s = M() s. X = StringIO() s.x.

Nothing syntactically -- just a little whitespace And yet it breaks completion. So there's definitely a parsing bug in there somewhere ( why they don't just use the ast module, I have no idea...) end of updates On first blush, I can't reproduce your problem; here's my test file: from os import path path. Now, I know it's not exactly your situation, but it shows that pythoncomplete knows about 'from And now the more in-depth example: from StringIO import StringIO s = StringIO() s.0: loc += " as %s" % alias self.scope.

Local(loc) freshscope = False as you can see, this is where it handles from statements Cheers.

Update: ooh, so I checked your example, and I get completion for x = Test() x. But not o = object() o. X = Test() o.x....I'm gonna do some digging update 2: revenge of Dr. Strangelove and...this is where it get's weird.

From StringIO import StringIO class M: pass s = M() s. X = StringIO() s.x.Completes. But this from StringIO import StringIO class M: pass s = M() s.

X = StringIO() s.x. Did you catch the difference? Nothing syntactically -- just a little whitespace And yet it breaks completion.So there's definitely a parsing bug in there somewhere (why they don't just use the ast module, I have no idea...) end of updates On first blush, I can't reproduce your problem; here's my test file: from os import path path.

And I get completion. Now, I know it's not exactly your situation, but it shows that pythoncomplete knows about 'from'. And now the more in-depth example: from StringIO import StringIO s = StringIO() s.And...completion!

Could you try that example to see if it works with builtin modules for you? If that's the case, you should probably check paths... If it still doesn't work, and you're up for some digging around, check out line #555 of pythoncomplete. Vim at /usr/share/vim/vim72/autoload/pythoncomplete.

Vim on my ubuntu machine: elif token == 'from': mod, token = self. _parsedotname() if not mod or token! = "import": print "from: syntax error..." continue names = self.

_parseimportlist() for name, alias in names: loc = "from %s import %s" % (mod,name) if len(alias) > 0: loc += " as %s" % alias self.scope. Local(loc) freshscope = False as you can see, this is where it handles from statements.Cheers.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions