@@ -159,11 +159,12 @@ def use_snippets(document, position):
159159def _format_completion (d , include_params = True , profile_ranges = None ):
160160 t1 = datetime .now ()
161161 completion = {
162- # 'documentation': _utils.format_docstring(d.docstring()),
162+ 'documentation' : _utils .format_docstring (d .docstring ()),
163163 }
164164 t2 = datetime .now ()
165+ sig = d .get_signatures ()
165166 completion .update ({
166- 'label' : d . name ,
167+ 'label' : _label ( d , sig ) ,
167168 'kind' : _TYPE_MAP .get (d .type ),
168169 'sortText' : _sort_text (d ),
169170 'insertText' : d .name ,
@@ -177,10 +178,12 @@ def _format_completion(d, include_params=True, profile_ranges=None):
177178 path = path .replace ('/' , '\\ /' )
178179 completion ['insertText' ] = path
179180
181+ profile_ranges ['documentation' ] += (t2 - t1 )
182+ profile_ranges ['update' ] += (t3 - t2 )
183+ profile_ranges ['total' ] += (t3 - t1 )
180184 if not include_params :
181185 return completion
182186
183- sig = d .get_signatures ()
184187 if sig and not is_exception_class (d .name ):
185188 completion ['label' ] = _label (d , sig )
186189 positional_args = [param for param in sig [0 ].params
@@ -204,9 +207,6 @@ def _format_completion(d, include_params=True, profile_ranges=None):
204207 completion ['insertText' ] = d .name + '()'
205208 # t4 = datetime.now()
206209
207- profile_ranges ['documentation' ] += (t2 - t1 )
208- profile_ranges ['update' ] += (t3 - t2 )
209- profile_ranges ['total' ] += (t3 - t1 )
210210 # profile_ranges['path'] += (t3 - t2)
211211 # profile_ranges['forks'] += (t4 - t3)
212212
0 commit comments