1
0
forked from VimPlug/jedi

get_code in Definition.description should not return first prefix.

This commit is contained in:
Dave Halter
2014-11-21 15:33:38 +01:00
parent f604066288
commit eb0bfb4381
4 changed files with 22 additions and 5 deletions

View File

@@ -471,11 +471,10 @@ class Script(object):
# The Evaluator.goto function checks for definitions, but since we
# use a reverse tokenizer, we have new name_part objects, so we
# have to check the user_stmt here for positions.
if False and isinstance(user_stmt, pr.ExprStmt):
if isinstance(user_stmt, pr.ExprStmt) \
and isinstance(last_name.parent, pr.ExprStmt):
for name in user_stmt.get_defined_names():
if name.start_pos <= self._pos <= name.end_pos \
and (not isinstance(name.parent, pr.Call)
or name.parent.next is None):
if name.start_pos <= self._pos <= name.end_pos:
return [name]
defs = self._evaluator.goto(last_name)