mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-26 04:27:17 +08:00
speed debugging for completions
This commit is contained in:
@@ -105,6 +105,8 @@ class Script(object):
|
|||||||
pass
|
pass
|
||||||
return [name]
|
return [name]
|
||||||
|
|
||||||
|
|
||||||
|
debug.speed('complete start')
|
||||||
path = self.module.get_path_until_cursor()
|
path = self.module.get_path_until_cursor()
|
||||||
path, dot, like = self._get_completion_parts(path)
|
path, dot, like = self._get_completion_parts(path)
|
||||||
|
|
||||||
@@ -166,6 +168,7 @@ class Script(object):
|
|||||||
len(like), s)
|
len(like), s)
|
||||||
comps.append(new)
|
comps.append(new)
|
||||||
|
|
||||||
|
debug.speed('complete end')
|
||||||
|
|
||||||
return sorted(comps, key=lambda x: (x.word.startswith('__'),
|
return sorted(comps, key=lambda x: (x.word.startswith('__'),
|
||||||
x.word.startswith('_'),
|
x.word.startswith('_'),
|
||||||
@@ -177,6 +180,7 @@ class Script(object):
|
|||||||
debug.dbg('start: %s in %s' % (goto_path, self.parser.scope))
|
debug.dbg('start: %s in %s' % (goto_path, self.parser.scope))
|
||||||
|
|
||||||
user_stmt = self.parser.user_stmt
|
user_stmt = self.parser.user_stmt
|
||||||
|
debug.speed('parsed')
|
||||||
if not user_stmt and len(goto_path.split('\n')) > 1:
|
if not user_stmt and len(goto_path.split('\n')) > 1:
|
||||||
# If the user_stmt is not defined and the goto_path is multi line,
|
# If the user_stmt is not defined and the goto_path is multi line,
|
||||||
# something's strange. Most probably the backwards tokenizer
|
# something's strange. Most probably the backwards tokenizer
|
||||||
|
|||||||
Reference in New Issue
Block a user