Skip to content

Commit

Permalink
Autocomplete: Expose Jedi signature to frontends
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeiger committed Jun 6, 2017
1 parent 8acaee8 commit 69bfd6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ipykernel/ipkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,21 +274,22 @@ def do_complete(self, code, cursor_pos):

def _experimental_do_complete(self, code, cursor_pos):
"""
Experimental completions from IPython, using Jedi.
Experimental completions from IPython, using Jedi.
"""
if cursor_pos is None:
cursor_pos = len(code)
with provisionalcompleter():
raw_completions = self.shell.Completer.completions(code, cursor_pos)
completions = list(rectify_completions(code, raw_completions))

comps = []
for comp in completions:
comps.append(dict(
start=comp.start,
end=comp.end,
text=comp.text,
type=comp.type,
signature=getattr(comp, 'signature', '')
))

if completions:
Expand Down

0 comments on commit 69bfd6f

Please sign in to comment.