This is a development version (latest) and may be unstable. Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython latest / IPython / core / completer / IPCompleter / _complete

function

IPython.core.completer:IPCompleter._complete

source: /IPython/core/completer.py :3573

Signature

def   _complete ( self * cursor_line cursor_pos line_buffer = None text = None full_text = None )  →  _CompleteResult

Summary

Like complete but can also returns raw jedi completions as well as the origin of the completion text. This could (and should) be made much cleaner but that will be simpler once we drop the old (and stateful) complete API.

Extended Summary

With current provisional API, cursor_pos act both (depending on the caller) as the offset in the text or line_buffer, or as the column when passing multiline strings this could/should be renamed but would add extra noise.

Parameters

cursor_line

Index of the line the cursor is on. 0 indexed.

cursor_pos

Position of the cursor in the current line/line_buffer/text. 0 indexed.

line_buffer : optional, str

The current line the cursor is in, this is mostly due to legacy reason that readline could only give a us the single current line. Prefer full_text.

text : str

The current "token" the cursor is in, mostly also for historical reasons. as the completer would trigger only after the current line was parsed.

full_text : str

Full text of the current cell.

Returns

: An ordered dictionary where keys are identifiers of completion
: matchers and values are ``MatcherResult``s.

Aliases

  • IPython.core.completer.IPCompleter._complete