(
&self,
line: &str,
pos: usize,
ctx: &Context<'_>,
)
| 384 | impl Completer for MyHelper { |
| 385 | type Candidate = Pair; |
| 386 | fn complete( |
| 387 | &self, |
| 388 | line: &str, |
| 389 | pos: usize, |
| 390 | ctx: &Context<'_>, |
| 391 | ) -> Result<(usize, Vec<Pair>), ReadlineError> { |
| 392 | match partial_parse(line, pos, self) { |
| 393 | Some((pos, Partial::Call(canister_id, meth))) => { |
| 394 | let mut map = self.canister_map.borrow_mut(); |
| 395 | Ok(match map.get(&self.agent, &canister_id) { |
| 396 | Ok(info) => (pos, info.match_method(&meth)), |
| 397 | Err(_) => (pos, Vec::new()), |
| 398 | }) |
| 399 | } |
| 400 | Some((pos, Partial::Val(v, rest))) => Ok((pos, match_selector(&v, &rest))), |
| 401 | _ => match match_type(line, self) { |
| 402 | Some(res) => Ok(res), |
| 403 | None => self.completer.complete(line, pos, ctx), |
| 404 | }, |
| 405 | } |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | fn match_type(line: &str, helper: &MyHelper) -> Option<(usize, Vec<Pair>)> { |
nothing calls this directly
no test coverage detected