@@ -155,6 +155,9 @@ def _serialize_completions(self, script, identifier=None, prefix=''): |
155 | 155 | 'raw_type': '', |
156 | 156 | 'rightLabel': self._additional_info(signature) |
157 | 157 | } |
| 158 | + _completion['description'] = '' |
| 159 | + _completion['raw_docstring'] = '' |
| 160 | + |
158 | 161 | # we pass 'text' here only for fuzzy matcher |
159 | 162 | if value: |
160 | 163 | _completion['snippet'] = '%s=${1:%s}$0' % (name, value) |
@@ -188,6 +191,15 @@ def _serialize_completions(self, script, identifier=None, prefix=''): |
188 | 191 | 'raw_docstring': completion.docstring(raw=True), |
189 | 192 | 'rightLabel': self._additional_info(completion) |
190 | 193 | } |
| 194 | + for c in _completions: |
| 195 | + if c['text'] == _completion['text']: |
| 196 | + c['type'] = _completion['type'] |
| 197 | + c['raw_type'] = _completion['raw_type'] |
| 198 | + if len(c['description']) == 0 and len(c['raw_docstring']) == 0: |
| 199 | + c['description'] = _completion['description'] |
| 200 | + c['raw_docstring'] = _completion['description'] |
| 201 | + |
| 202 | + |
191 | 203 | if any([c['text'].split('=')[0] == _completion['text'] |
192 | 204 | for c in _completions]): |
193 | 205 | # ignore function arguments we already have |
@@ -388,7 +400,7 @@ def _serialize_tooltip(self, definitions, identifier=None): |
388 | 400 | if definition.type == 'module': |
389 | 401 | signature = definition.full_name |
390 | 402 | description = definition.docstring(raw=True).strip() |
391 | | - if not description and not definition.get_line_code(): |
| 403 | + if not description and hasattr(definition, 'get_line_code'): |
392 | 404 | # jedi returns an empty string for compiled objects |
393 | 405 | description = definition.docstring().strip() |
394 | 406 | _definition = { |
|