forked from VimPlug/jedi
Fix an issue with names
This commit is contained in:
@@ -232,7 +232,8 @@ class ValueNameMixin(object):
|
|||||||
if not doc and self._value.is_stub():
|
if not doc and self._value.is_stub():
|
||||||
from jedi.inference.gradual.conversion import convert_names
|
from jedi.inference.gradual.conversion import convert_names
|
||||||
names = convert_names([self], prefer_stub_to_compiled=False)
|
names = convert_names([self], prefer_stub_to_compiled=False)
|
||||||
return _merge_name_docs(names)
|
if self not in names:
|
||||||
|
return _merge_name_docs(names)
|
||||||
return doc
|
return doc
|
||||||
|
|
||||||
def _get_qualified_names(self):
|
def _get_qualified_names(self):
|
||||||
|
|||||||
@@ -429,3 +429,10 @@ def test_completion_cache(Script, module_injector):
|
|||||||
cls, = c.infer()
|
cls, = c.infer()
|
||||||
assert cls.type == 'class'
|
assert cls.type == 'class'
|
||||||
assert cls.docstring() == 'foo()\n\ndoc2'
|
assert cls.docstring() == 'foo()\n\ndoc2'
|
||||||
|
|
||||||
|
|
||||||
|
def test_typing_module_completions(Script):
|
||||||
|
for c in Script('import typing; typing.').completions():
|
||||||
|
# Just make sure that there are no errors
|
||||||
|
c.type
|
||||||
|
c.docstring()
|
||||||
|
|||||||
Reference in New Issue
Block a user