mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 23:04:48 +08:00
fix for github issue 7, goto function works now right for 'from import' statements
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user