euporie.core.suggest
Suggest line completions from kernel history.
Functions
|
Accept both booleans and Filters as input and turn it into a Filter. |
Classes
Base class for auto suggestion implementations. |
|
|
Auto suggest that can be turned on and of according to a certain condition. |
|
Auto suggest that can be turned on and of according to a certain condition. |
|
Suggest line completions from a |
|
Suggest line completions from kernel history. |
|
Suggestion returned by an auto-suggest algorithm. |
deque([iterable[, maxlen]]) --> deque object |
- class euporie.core.suggest.ConditionalAutoSuggestAsync(auto_suggest: AutoSuggest, filter: bool | Filter)
Bases:
prompt_toolkit.auto_suggest.ConditionalAutoSuggest
Auto suggest that can be turned on and of according to a certain condition.
- get_suggestion(buffer: Buffer, document: Document) Suggestion | None
Return None or a
Suggestion
instance.We receive both
Buffer
andDocument
. The reason is that auto suggestions are retrieved asynchronously. (Like completions.) The buffer text could be changed in the meantime, butdocument
contains the buffer document like it was at the start of the auto suggestion call. So, from here, don’t accessbuffer.text
, but usedocument.text
instead.
- async get_suggestion_async(buffer: Buffer, document: Document) Suggestion | None
Get suggestions asynchronously if the filter allows.
- class euporie.core.suggest.HistoryAutoSuggest(history: History, cache_size: int = 100000)
Bases:
prompt_toolkit.auto_suggest.AutoSuggest
Suggest line completions from a
History
object.- get_suggestion(buffer: Buffer, document: Document) Suggestion | None
Get a line completion suggestion.
- async get_suggestion_async(buff: Buffer, document: Document) Suggestion | None
Return a
Future
which is set when the suggestions are ready. This function can be overloaded in order to provide an asynchronous implementation.
- lookup_suggestion(line: str) prompt_toolkit.auto_suggest.Suggestion | None
Find the most recent matching line in the history.
- class euporie.core.suggest.KernelAutoSuggest(kernel: Kernel)
Bases:
prompt_toolkit.auto_suggest.AutoSuggest
Suggest line completions from kernel history.
- get_suggestion(buffer: Buffer, document: Document) Suggestion | None
Doe nothing.
- async get_suggestion_async(buff: Buffer, document: Document) Suggestion | None
Return suggestions based on matching kernel history.