summaryrefslogtreecommitdiff
path: root/cli/tools/repl.rs
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-06-22 08:07:26 +0800
committerGitHub <noreply@github.com>2021-06-22 02:07:26 +0200
commit68c519d06161920d21afc2e40db11230af62baee (patch)
tree3e2d6d21733864642d4479302cb72284397d67f5 /cli/tools/repl.rs
parent9105892ec8b454571c56883eace557eee25b3301 (diff)
feat(repl): show list completion (#11001)
Diffstat (limited to 'cli/tools/repl.rs')
-rw-r--r--cli/tools/repl.rs8
1 files changed, 7 insertions, 1 deletions
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(());