forked from VimPlug/jedi
Refactor _get_function_call_and_param_index_at_point
This commit is contained in:
24
jedi/api.py
24
jedi/api.py
@@ -243,10 +243,7 @@ class Script(object):
|
|||||||
|
|
||||||
# Fetch definition of callee
|
# Fetch definition of callee
|
||||||
if not goto_path:
|
if not goto_path:
|
||||||
try:
|
(call, _) = self._get_function_call_and_param_index_at_point()
|
||||||
(call, _) = self._get_function_call_and_param_index_at_point()
|
|
||||||
except NotFoundError:
|
|
||||||
call = None
|
|
||||||
if call is not None:
|
if call is not None:
|
||||||
while call.next is not None:
|
while call.next is not None:
|
||||||
call = call.next
|
call = call.next
|
||||||
@@ -398,9 +395,8 @@ class Script(object):
|
|||||||
:rtype: :class:`api_classes.CallDef`
|
:rtype: :class:`api_classes.CallDef`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
(call, index) = self._get_function_call_and_param_index_at_point()
|
||||||
(call, index) = self._get_function_call_and_param_index_at_point()
|
if call is None:
|
||||||
except NotFoundError:
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
user_stmt = self._parser.user_stmt
|
user_stmt = self._parser.user_stmt
|
||||||
@@ -456,12 +452,18 @@ class Script(object):
|
|||||||
raise NotFoundError()
|
raise NotFoundError()
|
||||||
|
|
||||||
debug.speed('func_call start')
|
debug.speed('func_call start')
|
||||||
|
call = None
|
||||||
|
index = 0
|
||||||
if settings.use_function_definition_cache:
|
if settings.use_function_definition_cache:
|
||||||
call, index = check_cache()
|
try:
|
||||||
|
call, index = check_cache()
|
||||||
|
except NotFoundError:
|
||||||
|
pass
|
||||||
if call is None:
|
if call is None:
|
||||||
call, index = check_user_stmt(self._parser.user_stmt)
|
try:
|
||||||
if call is None:
|
call, index = check_user_stmt(self._parser.user_stmt)
|
||||||
raise NotFoundError()
|
except NotFoundError:
|
||||||
|
pass
|
||||||
debug.speed('func_call parsed')
|
debug.speed('func_call parsed')
|
||||||
return call, index
|
return call, index
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user