MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / complete_command

Function complete_command

crates/chat-cli/src/cli/chat/prompt.rs:162–171  ·  view source on GitHub ↗

Complete commands that start with a slash

(commands: Vec<&'static str>, word: &str, start: usize)

Source from the content-addressed store, hash-verified

160
161/// Complete commands that start with a slash
162fn complete_command(commands: Vec<&'static str>, word: &str, start: usize) -> (usize, Vec<String>) {
163 (
164 start,
165 commands
166 .iter()
167 .filter(|p| p.starts_with(word))
168 .map(|s| (*s).to_owned())
169 .collect(),
170 )
171}
172
173/// A wrapper around FilenameCompleter that provides enhanced path detection
174/// and completion capabilities for the chat interface.

Callers 1

completeMethod · 0.85

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected