IPython 8.4.0 Pypi GitHub Homepage
Other Docs
NotesParametersYields
completions(self, text: str, offset: int) -> Iterator[IPython.core.completer.Completion]
warning

Unstable

This function is unstable, API may change without warning. It will also raise unless use in proper context manager.

Notes

The cursor on a text can either be seen as being "in between" characters or "On" a character depending on the interface visible to the user. For consistency the cursor being on "in between" characters X and Y is equivalent to the cursor being "on" character Y, that is to say the character the cursor is on is considered as being after the cursor.

Combining characters may span more that one position in the text.

note

If IPCompleter.debug is :None:any:`True` will yield a --jedi/ipython-- fake Completion token to distinguish completion returned by Jedi and usual IPython completion.

note

Completions are not completely deduplicated yet. If identical completions are coming from different sources this function does not ensure that each completion object will only be present once.

Parameters

text : str

Full text of the current input, multi line string.

offset : int

Integer representing the position of the cursor in text . Offset is 0-based indexed.

Returns an iterator over the possible completions

Yields

Completion

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /IPython/core/completer.py#1848
type: <class 'function'>
Commit: