MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / view_name_candidates

Function view_name_candidates

atomic-cli/src/commands/complete.rs:34–42  ·  view source on GitHub ↗

View-name completion candidates matching `prefix`, sorted. Pure over the repository so it can be unit-tested without the shell completion machinery.

(repo: &Repository, prefix: &str)

Source from the content-addressed store, hash-verified

32/// Pure over the repository so it can be unit-tested without the shell
33/// completion machinery.
34pub(crate) fn view_name_candidates(repo: &Repository, prefix: &str) -> Vec<String> {
35 let mut names = match repo.list_views() {
36 Ok(v) => v,
37 Err(_) => return Vec::new(),
38 };
39 names.retain(|n| n.starts_with(prefix));
40 names.sort();
41 names
42}
43
44/// Change-hash completion candidates drawn from the change store.
45///

Callers 2

complete_view_namesFunction · 0.85

Calls 2

sortMethod · 0.80
list_viewsMethod · 0.45

Tested by 1