diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-20 18:27:23 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-20 18:27:23 +0000 |
commit | f133702f723203a60a1b4dade51418261cdbc133 (patch) | |
tree | 4d6d38d2e6185bb39b08ccfd5b89cdb5740d5ef8 /crates/ra_lsp_server/src/main_loop | |
parent | b89f8b6b4929ec09be4f9b13f87ad56b3235bd39 (diff) | |
parent | fd8db14c2fcec7801edbdbb8e7f4d4c982a3da09 (diff) |
Merge #574
574: refactor completions to use TextEdit instead of InsertText r=matklad a=gfreezy
1. migrate from `insertText` to `TextEdit` from `CompleteItem`
2. use `insta` to test completions
Co-authored-by: gfreezy <[email protected]>
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 02393f728..497f819be 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -340,7 +340,11 @@ pub fn handle_completion( | |||
340 | None => return Ok(None), | 340 | None => return Ok(None), |
341 | Some(items) => items, | 341 | Some(items) => items, |
342 | }; | 342 | }; |
343 | let items = items.into_iter().map(|item| item.conv()).collect(); | 343 | let line_index = world.analysis().file_line_index(position.file_id); |
344 | let items = items | ||
345 | .into_iter() | ||
346 | .map(|item| item.conv_with(&line_index)) | ||
347 | .collect(); | ||
344 | 348 | ||
345 | Ok(Some(req::CompletionResponse::Array(items))) | 349 | Ok(Some(req::CompletionResponse::Array(items))) |
346 | } | 350 | } |