forked from VimPlug/jedi
fix usage problem on **kwargs params
This commit is contained in:
11
jedi/api.py
11
jedi/api.py
@@ -411,11 +411,12 @@ class Script(object):
|
|||||||
"""
|
"""
|
||||||
user_stmt = self._parser.user_stmt
|
user_stmt = self._parser.user_stmt
|
||||||
definitions, search_name = self._goto(add_import_name=True)
|
definitions, search_name = self._goto(add_import_name=True)
|
||||||
if isinstance(user_stmt, pr.Statement) \
|
if isinstance(user_stmt, pr.Statement):
|
||||||
and self.pos < user_stmt.get_commands()[0].start_pos:
|
c = user_stmt.get_commands()[0]
|
||||||
# the search_name might be before `=`
|
if not isinstance(c, unicode) and self.pos < c.start_pos:
|
||||||
definitions = [v for v in user_stmt.set_vars
|
# the search_name might be before `=`
|
||||||
if unicode(v.names[-1]) == search_name]
|
definitions = [v for v in user_stmt.set_vars
|
||||||
|
if unicode(v.names[-1]) == search_name]
|
||||||
if not isinstance(user_stmt, pr.Import):
|
if not isinstance(user_stmt, pr.Import):
|
||||||
# import case is looked at with add_import_name option
|
# import case is looked at with add_import_name option
|
||||||
definitions = dynamic.usages_add_import_modules(definitions,
|
definitions = dynamic.usages_add_import_modules(definitions,
|
||||||
|
|||||||
@@ -203,3 +203,10 @@ class TestProperty:
|
|||||||
def b(self):
|
def b(self):
|
||||||
#< 13 (-5,8), (0,13)
|
#< 13 (-5,8), (0,13)
|
||||||
self.rw_prop
|
self.rw_prop
|
||||||
|
|
||||||
|
# -----------------
|
||||||
|
# *args, **kwargs
|
||||||
|
# -----------------
|
||||||
|
#< 11 (1,11), (0,8)
|
||||||
|
def f(**kwargs):
|
||||||
|
return kwargs
|
||||||
|
|||||||
Reference in New Issue
Block a user