forked from VimPlug/jedi
added speed notifications for get_in_function_call
This commit is contained in:
+6
-1
@@ -76,6 +76,7 @@ class Script(object):
|
|||||||
self.module = modules.ModuleWithCursor(source_path, source=source,
|
self.module = modules.ModuleWithCursor(source_path, source=source,
|
||||||
position=self.pos)
|
position=self.pos)
|
||||||
self.source_path = source_path
|
self.source_path = source_path
|
||||||
|
debug.reset_time()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def parser(self):
|
def parser(self):
|
||||||
@@ -342,10 +343,12 @@ class Script(object):
|
|||||||
else:
|
else:
|
||||||
raise NotFoundError()
|
raise NotFoundError()
|
||||||
|
|
||||||
|
debug.speed('func_call start')
|
||||||
try:
|
try:
|
||||||
call, index = check_cache()
|
call, index = check_cache()
|
||||||
except NotFoundError:
|
except NotFoundError:
|
||||||
return None
|
return None
|
||||||
|
debug.speed('func_call parsed')
|
||||||
|
|
||||||
if call is None:
|
if call is None:
|
||||||
user_stmt = self.parser.user_stmt
|
user_stmt = self.parser.user_stmt
|
||||||
@@ -355,6 +358,7 @@ class Script(object):
|
|||||||
|
|
||||||
with helpers.scale_speed_settings(settings.scale_get_in_function_call):
|
with helpers.scale_speed_settings(settings.scale_get_in_function_call):
|
||||||
origins = evaluate.follow_call(call)
|
origins = evaluate.follow_call(call)
|
||||||
|
debug.speed('func_call followed')
|
||||||
|
|
||||||
if len(origins) == 0:
|
if len(origins) == 0:
|
||||||
return None
|
return None
|
||||||
@@ -395,7 +399,8 @@ class Script(object):
|
|||||||
evaluate.clear_caches()
|
evaluate.clear_caches()
|
||||||
|
|
||||||
|
|
||||||
def set_debug_function(func_cb):
|
def set_debug_function(func_cb=debug.print_to_stdout, warnings=True,
|
||||||
|
notices=True, speed=True):
|
||||||
"""
|
"""
|
||||||
You can define a callback debug function to get all the debug messages.
|
You can define a callback debug function to get all the debug messages.
|
||||||
:param func_cb: The callback function for debug messages, with n params.
|
:param func_cb: The callback function for debug messages, with n params.
|
||||||
|
|||||||
+4
-1
@@ -23,7 +23,10 @@ enable_notice = False
|
|||||||
debug_function = None
|
debug_function = None
|
||||||
ignored_modules = ['parsing', 'builtin', 'jedi.builtin', 'jedi.parsing']
|
ignored_modules = ['parsing', 'builtin', 'jedi.builtin', 'jedi.parsing']
|
||||||
|
|
||||||
start_time = time.time()
|
|
||||||
|
def reset_time():
|
||||||
|
global start_time
|
||||||
|
start_time = time.time()
|
||||||
|
|
||||||
|
|
||||||
def dbg(*args):
|
def dbg(*args):
|
||||||
|
|||||||
Reference in New Issue
Block a user