forked from VimPlug/jedi
The docstring of import completions was wrong.
This is fixed now. However, since this might massively decrease performance, it's not enabled by default. You can enable it with `docstring(fast=False)` (see test changes), but I wouldn't recommend it at this point. Fixes #656.
This commit is contained in:
@@ -77,3 +77,15 @@ def test_cache_works_with_sys_path_param(tmpdir):
|
||||
|
||||
assert 'bar' in [c.name for c in bar_completions]
|
||||
assert 'foo' not in [c.name for c in bar_completions]
|
||||
|
||||
|
||||
def test_import_completion_docstring():
|
||||
import abc
|
||||
s = jedi.Script('"""test"""\nimport ab')
|
||||
completions = s.completions()
|
||||
assert len(completions) == 1
|
||||
assert completions[0].docstring(fast=False) == abc.__doc__
|
||||
|
||||
# However for performance reasons not all modules are loaded and the
|
||||
# docstring is empty in this case.
|
||||
assert completions[0].docstring() == ''
|
||||
|
||||
Reference in New Issue
Block a user