Skip to content

Commit

Permalink
Merge pull request #12798 from Carreau/auto-backport-of-pr-12255-on-7.x
Browse files Browse the repository at this point in the history
Manual backport of pr 12255 on 7.x
  • Loading branch information
Carreau committed Feb 1, 2021
2 parents 09698b5 + 8abc94f commit 6009e67
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions IPython/core/completer.py
Expand Up @@ -988,6 +988,15 @@ def _make_signature(completion)-> str:
"""

# it looks like this might work on jedi 0.17
if hasattr(completion, 'get_signatures'):
signatures = completion.get_signatures()
if not signatures:
return '(?)'

c0 = completion.get_signatures()[0]
return '('+c0.to_string().split('(', maxsplit=1)[1]

return '(%s)'% ', '.join([f for f in (_formatparamchildren(p) for signature in completion.get_signatures()
for p in signature.defined_names()) if f])

Expand Down

0 comments on commit 6009e67

Please sign in to comment.