Class AutoCompleter<S extends Source>

java.lang.Object
studio.mevera.imperat.command.suggestions.AutoCompleter<S>

@AvailableSince("1.0.0") public abstract class AutoCompleter<S extends Source> extends Object
Represents a class that's responsible for Handling all auto-completion processes during tab-completion per one command, regardless of the sender valueType
  • Field Details

  • Constructor Details

    • AutoCompleter

      protected AutoCompleter(Command<S> command)
  • Method Details

    • createNative

      public static <S extends Source> AutoCompleter<S> createNative(Command<S> command)
    • getLastArg

      @NotNull public static @NotNull CompletionArg getLastArg(ArgumentInput argumentInput)
    • autoComplete

      public final CompletableFuture<List<String>> autoComplete(Imperat<S> dispatcher, S sender, String label, String[] args)
      Autocompletes an argument from the whole position of the argument-raw input
      Parameters:
      dispatcher - the command dispatcher
      sender - the sender writing the command
      args - the args for raw input
      Returns:
      the auto-completed results
    • autoComplete

      public abstract CompletableFuture<List<String>> autoComplete(SuggestionContext<S> context)
      Autocompletes an argument from the whole position of the argument-raw input
      Parameters:
      context - the context for suggestions
      Returns:
      the auto-completed results