diff options
author | gfreezy <[email protected]> | 2019-01-19 14:02:50 +0000 |
---|---|---|
committer | gfreezy <[email protected]> | 2019-01-19 14:02:50 +0000 |
commit | d08e81cdd818dd3378c292767e15a38e6bbc6f6c (patch) | |
tree | e07b3363f21912ca7aaca4ae1dce482c0bcd6f85 /crates/ra_lsp_server/src/main_loop | |
parent | fa43ef30f4f96fc8e4ea1f9c4492bcb07b3335ca (diff) |
refactor completions to use TextEdit instead of InsertText
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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( | |||
337 | None => return Ok(None), | 337 | None => return Ok(None), |
338 | Some(items) => items, | 338 | Some(items) => items, |
339 | }; | 339 | }; |
340 | let items = items.into_iter().map(|item| item.conv()).collect(); | 340 | let line_index = world.analysis().file_line_index(position.file_id); |
341 | let items = items | ||
342 | .into_iter() | ||
343 | .map(|item| item.conv_with(&line_index)) | ||
344 | .collect(); | ||
341 | 345 | ||
342 | Ok(Some(req::CompletionResponse::Array(items))) | 346 | Ok(Some(req::CompletionResponse::Array(items))) |
343 | } | 347 | } |