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, 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.


Adjust the height for showing autocompletion menu.

suggestion_completion(self, document, line)[source]

Provides a completion based on the current auto-suggestion.