1
0
forked from VimPlug/jedi

Goto should not include imports that cannot be followed.

This commit is contained in:
Dave Halter
2015-04-23 02:37:22 +02:00
parent 691e5a8969
commit d04241b482
5 changed files with 29 additions and 12 deletions

View File

@@ -305,7 +305,8 @@ class Evaluator(object):
s = imports.ImportWrapper(self, name)
for n in s.follow(is_goto=True):
yield n
yield name
else:
yield name
stmt = name.get_definition()
par = name.parent
@@ -340,7 +341,8 @@ class Evaluator(object):
elif isinstance(par, (pr.Param, pr.Function, pr.Class)) and par.name is name:
return [name]
elif isinstance(stmt, pr.Import):
return imports.ImportWrapper(self, name).follow(is_goto=True)
modules = imports.ImportWrapper(self, name).follow(is_goto=True)
return list(resolve_implicit_imports(modules))
elif par.type == 'dotted_name': # Is a decorator.
index = par.children.index(name)
if index > 0: