Interface IAutoCompleter
Interface for pluggable auto-completion in terminal CLI input. Allows terminal components to provide tab-completion without depending on a specific auto-complete implementation (e.g. console commands).
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public interface IAutoCompleter
Properties
CurrentIndex
Gets the index of the completion currently applied to the input, within the set counted by SuggestionCount.
Declaration
int CurrentIndex { get; }
Property Value
| Type | Description |
|---|---|
| int |
SuggestionCount
Gets the number of completions the last Complete(string, bool) call had to choose from, or zero when nothing has been completed yet.
Declaration
int SuggestionCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Complete(string, bool)
Gets the auto-completion for the current input. Successive calls with the same input should cycle through available completions.
Declaration
string Complete(string input, bool backwards = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | input | The current input text. |
| bool | backwards |
|
Returns
| Type | Description |
|---|---|
| string | The completed text, or null if no completion is available. |
GetSuggestions(Span<string>)
Copies the available completions into destination.
Declaration
int GetSuggestions(Span<string> destination)
Parameters
| Type | Name | Description |
|---|---|---|
| Span<string> | destination | The span to copy into. Copying stops when it is full. |
Returns
| Type | Description |
|---|---|
| int | The number of completions copied. |
Reset()
Resets the auto-complete state. Should be called when the input text changes due to typing, editing, or history navigation.
Declaration
void Reset()