get_definition on import statements talked about in issue #7

This commit is contained in:
David Halter
2012-09-10 14:48:59 +02:00
parent 440eae7c15
commit 0a8338f73d
3 changed files with 18 additions and 4 deletions

View File

@@ -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)