From 682dd4dac0cf003998359d5fe8551daa126e50f6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 16 Nov 2020 17:27:36 +0100 Subject: Prepare to recompute completions on every keystroke If we set `is_incomplete: true`, VS Code will re-query completions after every keypress. --- crates/rust-analyzer/src/handlers.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 782797e85..4d1ebf6bf 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs @@ -573,7 +573,8 @@ pub(crate) fn handle_completion( .flat_map(|item| to_proto::completion_item(&line_index, line_endings, item)) .collect(); - Ok(Some(items.into())) + let completion_list = lsp_types::CompletionList { is_incomplete: false, items }; + Ok(Some(completion_list.into())) } pub(crate) fn handle_folding_range( -- cgit v1.2.3