From 68c519d06161920d21afc2e40db11230af62baee Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Tue, 22 Jun 2021 08:07:26 +0800 Subject: feat(repl): show list completion (#11001) --- cli/tools/repl.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cli/tools/repl.rs') diff --git a/cli/tools/repl.rs b/cli/tools/repl.rs index 069d3e417..891b2425d 100644 --- a/cli/tools/repl.rs +++ b/cli/tools/repl.rs @@ -19,6 +19,8 @@ use rustyline::highlight::Highlighter; use rustyline::validate::ValidationContext; use rustyline::validate::ValidationResult; use rustyline::validate::Validator; +use rustyline::CompletionType; +use rustyline::Config; use rustyline::Context; use rustyline::Editor; use rustyline_derive::{Helper, Hinter}; @@ -304,7 +306,11 @@ struct ReplEditor { impl ReplEditor { pub fn new(helper: EditorHelper, history_file_path: PathBuf) -> Self { - let mut editor = Editor::new(); + let editor_config = Config::builder() + .completion_type(CompletionType::List) + .build(); + + let mut editor = Editor::with_config(editor_config); editor.set_helper(Some(helper)); editor.load_history(&history_file_path).unwrap_or(()); -- cgit v1.2.3