euporie.core.suggest
Suggest line completions from kernel history.
Functions
|
Typed version of namedtuple. |
|
Least-recently-used cache decorator. |
|
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. |
|
Store position information for a history match. |
|
SequenceMatcher is a flexible class for comparing pairs of sequences of any type, so long as the sequence elements are hashable. |
|
Very simple cache that discards the oldest item when the cache size is exceeded. |
|
Suggest line completions from a |
|
Suggest line completions from a |
|
Suggestion returned by an auto-suggest algorithm. |
defaultdict(default_factory=None, /, [...]) --> dict with default factory |
|
A list-like sequence optimized for data accesses near its endpoints. |
|
|
Create a new function with partial application of the given arguments and keywords. |
- class euporie.core.suggest.ConditionalAutoSuggestAsync(auto_suggest: AutoSuggest, filter: bool | Filter)
Bases:
ConditionalAutoSuggestAuto 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
Suggestioninstance.We receive both
BufferandDocument. The reason is that auto suggestions are retrieved asynchronously. (Like completions.) The buffer text could be changed in the meantime, butdocumentcontains the buffer document like it was at the start of the auto suggestion call. So, from here, don’t accessbuffer.text, but usedocument.textinstead.
- async get_suggestion_async(buffer: Buffer, document: Document) Suggestion | None
Get suggestions asynchronously if the filter allows.
- class euporie.core.suggest.HistoryPosition(idx: int, context_start: int, context_end: int)
Bases:
NamedTupleStore position information for a history match.
- count(value, /)
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.
- class euporie.core.suggest.SimpleHistoryAutoSuggest(history: History, cache_size: int = 100000)
Bases:
AutoSuggestSuggest line completions from a
Historyobject.- 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
Futurewhich is set when the suggestions are ready. This function can be overloaded in order to provide an asynchronous implementation.
- lookup_suggestion(line: str) Suggestion | None
Find the most recent matching line in the history.
- class euporie.core.suggest.SmartHistoryAutoSuggest(history: History)
Bases:
AutoSuggestSuggest line completions from a
Historyobject.- 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
Futurewhich is set when the suggestions are ready. This function can be overloaded in order to provide an asynchronous implementation.