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());
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 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());
     }
 }