mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
get_definition on import statements talked about in issue #7
This commit is contained in:
@@ -233,6 +233,12 @@ def get_definition(source, line, column, source_path):
|
||||
else:
|
||||
scopes = set(_prepare_goto(source, pos, source_path, f, goto_path))
|
||||
|
||||
for s in scopes.copy():
|
||||
if isinstance(s, imports.ImportPath):
|
||||
scopes.remove(s)
|
||||
evaluate.statement_path = []
|
||||
scopes.update(evaluate.goto([s]))
|
||||
|
||||
# add keywords
|
||||
scopes |= keywords.get_keywords(string=goto_path, pos=pos)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user