Prompt Toolkit 2 Completer (xonsh.ptk2.completer)

Completer implementation to use with prompt_toolkit.

class xonsh.ptk2.completer.PromptToolkitCompleter(completer, ctx, shell)[source]

Simple prompt_toolkit Completer object.

It just redirects requests to normal Xonsh completer.

Takes instance of xonsh.completer.Completer, the xonsh execution context, and the shell instance itself.

get_completions(self, document, complete_event)[source]

Returns a generator for list of completions.

get_completions_async(self, document: prompt_toolkit.document.Document, complete_event: prompt_toolkit.completion.base.CompleteEvent) → AsyncGenerator[prompt_toolkit.completion.base.Completion, NoneType]

Asynchronous generator for completions. (Probably, you won’t have to override this.)

Asynchronous generator of Completion objects.

reserve_space(self)[source]

Adjust the height for showing autocompletion menu.

suggestion_completion(self, document, line)[source]

Provides a completion based on the current auto-suggestion.