Prompt Toolkit Completer (xonsh.ptk.completer)

Completer implementation to use with prompt_toolkit.

class xonsh.ptk.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(document, complete_event)[source]

Returns a generator for list of completions.

get_completions_async(document, complete_event)

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

This should return an iterable that can yield both Completion and Future objects. The Completion objects have to be wrapped in a AsyncGeneratorItem object.

If we drop Python 2 support in the future, this could become a true asynchronous generator.

reserve_space()[source]
suggestion_completion(document, line)[source]

Provides a completion based on the current auto-suggestion.