Skip to main content

WordList class

Namespace: Arlecchino.Editing · Assembly: Arlecchino

Words an application already holds: the names of its commands, the hosts it knows. They are read through a delegate, so the list is whatever it is when the word is being finished.

public sealed class WordList : ISuggestsWords

Implements ISuggestsWords

Constructors

MemberSummary
WordList(Func<IReadOnlyList<string>>)Offers what a delegate lists.

Methods

MemberSummary
SuggestAsync(CompletionAsk, CancellationToken)The words that begin with what has been typed, in the order they were listed. Case is forgiven, since a name is looked for rather than checked.

Constructors in detail

WordList(Func<IReadOnlyList<string>>)

public WordList(Func<IReadOnlyList<string>> words);

Offers what a delegate lists.

Parameters

NameTypeDescription
wordsFunc<TResult><IReadOnlyList<T><string>>Everything that could be typed, whether it fits what has been or not.

Methods in detail

SuggestAsync(CompletionAsk, CancellationToken)

public ValueTask<IReadOnlyList<string>> SuggestAsync(CompletionAsk ask, CancellationToken token);

The words that begin with what has been typed, in the order they were listed. Case is forgiven, since a name is looked for rather than checked.

Parameters

NameTypeDescription
askCompletionAskThe word and the line it stands in.
tokenCancellationTokenNot waited on: the list is already here.

Returns ValueTask<TResult><IReadOnlyList<T><string>> — What fits.