From 670833185b24064743fc72a7957d14f94d4631ac Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 6 May 2018 21:29:27 -0700 Subject: [PATCH] Start adding tab completion API --- schala-repl/src/lib.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/schala-repl/src/lib.rs b/schala-repl/src/lib.rs index 1f58b7c..102bbd1 100644 --- a/schala-repl/src/lib.rs +++ b/schala-repl/src/lib.rs @@ -123,19 +123,28 @@ fn run_noninteractive(filename: &str, languages: Vec rustyline::Result<(usize, Vec)> { + Ok((pos, vec!(format!("tab-completion-no-done"), format!("tab-completion-still-not-done")))) + } +} + struct Repl { options: EvalOptions, languages: Vec>, current_language_index: usize, interpreter_directive_sigil: char, - console: rustyline::Editor<()>, + console: rustyline::Editor, } impl Repl { fn new(languages: Vec>, initial_index: usize) -> Repl { let i = if initial_index < languages.len() { initial_index } else { 0 }; - let console = Editor::<()>::new(); + let mut console = Editor::::new(); + console.set_completer(Some(TabCompleteHandler {})); Repl { options: Repl::get_options(),