From d08e81cdd818dd3378c292767e15a38e6bbc6f6c Mon Sep 17 00:00:00 2001 From: gfreezy Date: Sat, 19 Jan 2019 22:02:50 +0800 Subject: refactor completions to use TextEdit instead of InsertText --- crates/ra_lsp_server/src/main_loop/handlers.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/ra_lsp_server/src/main_loop') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 8f9db68a2..d1e8c5774 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -337,7 +337,11 @@ pub fn handle_completion( None => return Ok(None), Some(items) => items, }; - let items = items.into_iter().map(|item| item.conv()).collect(); + let line_index = world.analysis().file_line_index(position.file_id); + let items = items + .into_iter() + .map(|item| item.conv_with(&line_index)) + .collect(); Ok(Some(req::CompletionResponse::Array(items))) } -- cgit v1.2.3