Skip to main content

ArgCompleter

Type Alias ArgCompleter 

Source
pub type ArgCompleter = Arc<dyn Fn(&[&str]) -> Vec<CompletionItem> + Send + Sync>;
Expand description

Closure that produces argument completions for a command, given the already-typed args (the last element is the partial arg being completed; may be empty for “just typed a space”).

The closure is responsible for filtering and ranking — callers do no further processing. For the common flat-list case use CompletionData::set_arg_completions, which builds an appropriate closure internally.

Aliased Type§

pub struct ArgCompleter { /* private fields */ }