1
0
forked from VimPlug/jedi

Fix an issue about boolean params resolving

This commit is contained in:
Dave Halter
2019-06-02 18:31:52 +02:00
parent 1213b51c66
commit 8ec6f54f86
2 changed files with 10 additions and 0 deletions

View File

@@ -363,6 +363,10 @@ class BaseDefinition(object):
for signature in context.get_signatures():
return [Definition(self._evaluator, n) for n in signature.get_param_names()]
if self.type == 'function' or self.type == 'class':
# Fallback, if no signatures were defined (which is probably by
# itself a bug).
return []
raise AttributeError('There are no params defined on this.')
def parent(self):

View File

@@ -174,6 +174,12 @@ def test_completion_params(Script):
assert [p.name for p in c.params] == ['s', 'sep']
def test_functions_should_have_params(Script):
for c in Script('bool.').completions():
if c.type == 'function':
assert isinstance(c.params, list)
def test_hashlib_params(Script, environment):
if environment.version_info < (3,):
pytest.skip()