diff --git a/functions.py b/functions.py index 4f0401f8..6ef49512 100644 --- a/functions.py +++ b/functions.py @@ -276,6 +276,10 @@ def goto(source, line, column, source_path): for s in scopes: if isinstance(s, imports.ImportPath): s = s.follow()[0] + try: + s = evaluate.statement_path[0] + except IndexError: + pass definitions.append(s) else: def remove_unreal_imports(names): diff --git a/test/completion/goto.py b/test/completion/goto.py index 348beefe..bf2d783b 100644 --- a/test/completion/goto.py +++ b/test/completion/goto.py @@ -103,3 +103,6 @@ mod1.a from import_tree import mod1 #! ['a=1'] mod1.a + +#! ['a=1.0'] +from import_tree.pkg.mod1 import a