From b47f9cee8cceabb3784259dd260bc5e633446b04 Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Sun, 21 Feb 2021 23:58:31 +0800 Subject: fix(repl): filter out symbol candidates (#9555) --- cli/tools/repl.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'cli/tools') diff --git a/cli/tools/repl.rs b/cli/tools/repl.rs index 73d1688e5..ce0879a85 100644 --- a/cli/tools/repl.rs +++ b/cli/tools/repl.rs @@ -115,8 +115,19 @@ impl Completer for Helper { .as_array() .unwrap() .iter() - .map(|r| r.get("name").unwrap().as_str().unwrap().to_string()) - .filter(|r| r.starts_with(&suffix[1..])) + .filter_map(|r| { + let name = r.get("name").unwrap().as_str().unwrap().to_string(); + + if name.starts_with("Symbol(") { + return None; + } + + if name.starts_with(&suffix[1..]) { + return Some(name); + } + + None + }) .collect(); return Ok((pos - (suffix.len() - 1), candidates)); -- cgit v1.2.3