forked from VimPlug/jedi
Fix an issue about boolean params resolving
This commit is contained in:
@@ -363,6 +363,10 @@ class BaseDefinition(object):
|
|||||||
for signature in context.get_signatures():
|
for signature in context.get_signatures():
|
||||||
return [Definition(self._evaluator, n) for n in signature.get_param_names()]
|
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.')
|
raise AttributeError('There are no params defined on this.')
|
||||||
|
|
||||||
def parent(self):
|
def parent(self):
|
||||||
|
|||||||
@@ -174,6 +174,12 @@ def test_completion_params(Script):
|
|||||||
assert [p.name for p in c.params] == ['s', 'sep']
|
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):
|
def test_hashlib_params(Script, environment):
|
||||||
if environment.version_info < (3,):
|
if environment.version_info < (3,):
|
||||||
pytest.skip()
|
pytest.skip()
|
||||||
|
|||||||
Reference in New Issue
Block a user