1
0
forked from VimPlug/jedi

Param defaults were not correctly followed when goto was used on them.

This commit is contained in:
Dave Halter
2017-09-03 00:22:59 +02:00
parent e85816cc85
commit b64690afb8
2 changed files with 4 additions and 4 deletions

View File

@@ -468,7 +468,7 @@ class Evaluator(object):
return helpers.evaluate_call_of_leaf(context, name)
def goto(self, context, name):
definition = name._get_definition(import_name_always=True)
definition = name._get_definition(import_name_always=True) or name
par = name.parent
typ = par.type
@@ -501,9 +501,9 @@ class Evaluator(object):
# Only take the parent, because if it's more complicated than just
# a name it's something you can "goto" again.
return [TreeNameDefinition(context, name)]
elif typ == 'param' and par.name:
elif definition.type == 'param':
return [ParamName(context, name)]
elif typ in ('param', 'funcdef', 'classdef') and par.name is name:
elif typ in ('funcdef', 'classdef') and par.name is name:
return [TreeNameDefinition(context, name)]
elif isinstance(definition, tree.Import):
module_names = imports.infer_import(context, name, is_goto=True)

View File

@@ -184,7 +184,7 @@ param = ClassDef
def ab1(param): pass
#! 9 ['param param']
def ab2(param): pass
#! 11 ['param a=param']
#! 11 ['param = ClassDef']
def ab3(a=param): pass
ab1(ClassDef);ab2(ClassDef);ab3(ClassDef)