diff --git a/jedi/evaluate/__init__.py b/jedi/evaluate/__init__.py index 0e6b2986..c1532ae1 100644 --- a/jedi/evaluate/__init__.py +++ b/jedi/evaluate/__init__.py @@ -516,7 +516,7 @@ class Evaluator(object): )) scope = name.get_parent_scope() - if tree.is_node(name.parent, 'trailer'): + if tree.is_node(name.parent, 'trailer') and name.parent.children[0] == '.': call = helpers.call_of_leaf(name, cut_own_trailer=True) types = self.eval_element(call) return resolve_implicit_imports(iterable.unite( diff --git a/test/completion/goto.py b/test/completion/goto.py index 84bcc2c8..4e178af1 100644 --- a/test/completion/goto.py +++ b/test/completion/goto.py @@ -30,6 +30,12 @@ b = math #! ['b = math'] b +#! 18 ['foo = 10'] +foo = 10;print(foo) + +# ----------------- +# classes +# ----------------- class C(object): def b(self): #! ['b = math']