Interface SuggestionProvider
public interface SuggestionProvider
SPI provider that supplies global tab-completion suggestions for parameter types.
When a command parameter has no @Suggest annotation and is not a built-in type,
the processor checks registered SuggestionProvider instances for matching types.
This eliminates the need to write @Suggest methods for commonly used custom types
like material keys, player names, etc.
-
Method Summary
Modifier and TypeMethodDescriptionGenerates a list of suggestions for the given type.Returns all type names this provider can suggest for.
-
Method Details
-
supportedTypes
Collection<String> supportedTypes()Returns all type names this provider can suggest for.- Returns:
- collection of fully qualified type names
-
suggest
List<String> suggest(com.palantir.javapoet.TypeName type, String sender, String args, String current) Generates a list of suggestions for the given type.- Parameters:
type- the parameter typesender- the variable name of the command sender in generated codeargs- the variable name of the args array in generated codecurrent- the variable name of the current input string in generated code- Returns:
- a list of suggestion strings, or
nullif no suggestions available
-