Skip to content

Commit

Permalink
Slow case demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ANtlord committed Jun 26, 2020
1 parent a0d32bb commit 21c484e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pyls/plugins/jedi_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,12 @@ def use_snippets(document, position):
def _format_completion(d, include_params=True, profile_ranges=None):
t1 = datetime.now()
completion = {
#'documentation': _utils.format_docstring(d.docstring()),
'documentation': _utils.format_docstring(d.docstring()),
}
t2 = datetime.now()
sig = d.get_signatures()
completion.update({
'label': d.name,
'label': _label(d, sig),
'kind': _TYPE_MAP.get(d.type),
'sortText': _sort_text(d),
'insertText': d.name,
Expand All @@ -177,10 +178,12 @@ def _format_completion(d, include_params=True, profile_ranges=None):
path = path.replace('/', '\\/')
completion['insertText'] = path

profile_ranges['documentation'] += (t2 - t1)
profile_ranges['update'] += (t3 - t2)
profile_ranges['total'] += (t3 - t1)
if not include_params:
return completion

sig = d.get_signatures()
if sig and not is_exception_class(d.name):
completion['label'] = _label(d, sig)
positional_args = [param for param in sig[0].params
Expand All @@ -204,9 +207,6 @@ def _format_completion(d, include_params=True, profile_ranges=None):
completion['insertText'] = d.name + '()'
# t4 = datetime.now()

profile_ranges['documentation'] += (t2 - t1)
profile_ranges['update'] += (t3 - t2)
profile_ranges['total'] += (t3 - t1)
# profile_ranges['path'] += (t3 - t2)
# profile_ranges['forks'] += (t4 - t3)

Expand Down

0 comments on commit 21c484e

Please sign in to comment.