1
0
forked from VimPlug/jedi

Fix an issue with keyword params, fixes #1356

This commit is contained in:
Dave Halter
2019-07-03 22:35:46 -07:00
parent be6c90d135
commit 947bfe7b78
6 changed files with 26 additions and 26 deletions

View File

@@ -530,17 +530,13 @@ class Definition(BaseDefinition):
"""
typ = self.type
tree_name = self._name.tree_name
if typ == 'param':
return typ + ' ' + self._name.to_string()
if typ in ('function', 'class', 'module', 'instance') or tree_name is None:
if typ == 'function':
# For the description we want a short and a pythonic way.
typ = 'def'
return typ + ' ' + self._name.string_name
elif typ == 'param':
code = search_ancestor(tree_name, 'param').get_code(
include_prefix=False,
include_comma=False
)
return typ + ' ' + code
definition = tree_name.get_definition() or tree_name
# Remove the prefix, because that's not what we want for get_code