Complete sandbox names by querying the active gateway.
(_prefix: &OsStr)
| 31 | |
| 32 | /// Complete sandbox names by querying the active gateway. |
| 33 | pub fn complete_sandbox_names(_prefix: &OsStr) -> Vec<CompletionCandidate> { |
| 34 | blocking_complete(async { |
| 35 | let (endpoint, gateway_name) = resolve_active_gateway()?; |
| 36 | let mut client = completion_grpc_client(&endpoint, &gateway_name).await?; |
| 37 | let response = client |
| 38 | .list_sandboxes(ListSandboxesRequest { |
| 39 | limit: 200, |
| 40 | offset: 0, |
| 41 | label_selector: String::new(), |
| 42 | }) |
| 43 | .await |
| 44 | .ok()?; |
| 45 | Some( |
| 46 | response |
| 47 | .into_inner() |
| 48 | .sandboxes |
| 49 | .into_iter() |
| 50 | .map(|s| CompletionCandidate::new(s.object_name())) |
| 51 | .collect(), |
| 52 | ) |
| 53 | }) |
| 54 | } |
| 55 | |
| 56 | /// Complete provider names by querying the active gateway. |
| 57 | pub fn complete_provider_names(_prefix: &OsStr) -> Vec<CompletionCandidate> { |