Tab Completer (xonsh.completer)

A (tab-)completer for xonsh.

class xonsh.completer.Completer[source]

This provides a list of optional completions for the xonsh shell.

complete(self, prefix, line, begidx, endidx, ctx=None)[source]

Complete the string, given a possible execution context.

Parameters
prefixstr

The string to match

linestr

The line that prefix appears on.

begidxint

The index in line that prefix starts on.

endidxint

The index in line that prefix ends on.

ctxIterable of str (ie dict, set, etc), optional

Names in the current execution context.

Returns
rtnlist of str

Possible completions of prefix, sorted alphabetically.

lprefixint

Length of the prefix to be replaced in the completion.