public override Task <Suggestions> ListSuggestions <TSource>(CommandContext <TSource> context, SuggestionsBuilder builder) { if ("true".StartsWith(builder.RemainingLowerCase)) { builder.Suggest("true"); } if ("false".StartsWith(builder.RemainingLowerCase)) { builder.Suggest("false"); } return(builder.BuildFuture()); }
public void suggest_appends() { var result = _builder.Suggest("world!").Build(); result.List.Should().BeEquivalentTo(new List <Suggestion.Suggestion> { new Suggestion.Suggestion(StringRange.Between(6, 7), "world!") }); result.Range.Should().BeEquivalentTo(StringRange.Between(6, 7)); result.IsEmpty().Should().Be(false); }
public override Task <Suggestions> ListSuggestions(CommandContext <TSource> context, SuggestionsBuilder builder) { if (Literal.ToLower().StartsWith(builder.Remaining.ToLower())) { return(builder.Suggest(Literal).BuildFuture()); } else { return(Suggestions.Empty()); } }