1
0
forked from VimPlug/jedi

Fixed list comprehension name lookups.

This commit is contained in:
Dave Halter
2014-12-01 00:08:27 +01:00
parent 3928f466cf
commit 68bd9160e2
4 changed files with 10 additions and 11 deletions

View File

@@ -215,6 +215,8 @@ class Evaluator(object):
# This is the first global lookup.
stmt = atom.get_definition()
scope = stmt.get_parent_until(pr.IsScope, include_current=True)
if isinstance(stmt, pr.CompFor):
stmt = stmt.get_parent_until((pr.ClassOrFunc, pr.ExprStmt))
return self.find_types(scope, atom, stmt.start_pos, search_global=True)
elif isinstance(atom, pr.Literal):
return [compiled.create(self, atom.eval())]