summaryrefslogtreecommitdiff
path: root/cli/tools/repl.rs
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-02-21 23:58:31 +0800
committerGitHub <noreply@github.com>2021-02-21 16:58:31 +0100
commitb47f9cee8cceabb3784259dd260bc5e633446b04 (patch)
tree6ca04a6bb795a4c049a656e3aa09816a6f93dd7c /cli/tools/repl.rs
parent14ec22e88044cbac5fffe347535ce8ac1bdb7ec5 (diff)
fix(repl): filter out symbol candidates (#9555)
Diffstat (limited to 'cli/tools/repl.rs')
-rw-r--r--cli/tools/repl.rs15
1 files changed, 13 insertions, 2 deletions
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));