diff options
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 1751d7fa8..252d1ba3e 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -2,9 +2,9 @@ use std::collections::HashMap; | |||
2 | 2 | ||
3 | use gen_lsp_server::ErrorCode; | 3 | use gen_lsp_server::ErrorCode; |
4 | use languageserver_types::{ | 4 | use languageserver_types::{ |
5 | CodeActionResponse, Command, CompletionItem, CompletionItemKind, Diagnostic, | 5 | CodeActionResponse, Command, Diagnostic, |
6 | DiagnosticSeverity, DocumentSymbol, Documentation, FoldingRange, FoldingRangeKind, | 6 | DiagnosticSeverity, DocumentSymbol, Documentation, FoldingRange, FoldingRangeKind, |
7 | FoldingRangeParams, InsertTextFormat, Location, MarkupContent, MarkupKind, MarkedString, Position, | 7 | FoldingRangeParams, Location, MarkupContent, MarkupKind, MarkedString, Position, |
8 | PrepareRenameResponse, RenameParams, SymbolInformation, TextDocumentIdentifier, TextEdit, | 8 | PrepareRenameResponse, RenameParams, SymbolInformation, TextDocumentIdentifier, TextEdit, |
9 | WorkspaceEdit, ParameterInformation, ParameterLabel, SignatureInformation, Hover, HoverContents, | 9 | WorkspaceEdit, ParameterInformation, ParameterLabel, SignatureInformation, Hover, HoverContents, |
10 | }; | 10 | }; |
@@ -419,22 +419,7 @@ pub fn handle_completion( | |||
419 | None => return Ok(None), | 419 | None => return Ok(None), |
420 | Some(items) => items, | 420 | Some(items) => items, |
421 | }; | 421 | }; |
422 | let items = items | 422 | let items = items.into_iter().map(|item| item.conv()).collect(); |
423 | .into_iter() | ||
424 | .map(|item| { | ||
425 | let mut res = CompletionItem { | ||
426 | label: item.label, | ||
427 | filter_text: item.lookup, | ||
428 | ..Default::default() | ||
429 | }; | ||
430 | if let Some(snip) = item.snippet { | ||
431 | res.insert_text = Some(snip); | ||
432 | res.insert_text_format = Some(InsertTextFormat::Snippet); | ||
433 | res.kind = Some(CompletionItemKind::Keyword); | ||
434 | }; | ||
435 | res | ||
436 | }) | ||
437 | .collect(); | ||
438 | 423 | ||
439 | Ok(Some(req::CompletionResponse::Array(items))) | 424 | Ok(Some(req::CompletionResponse::Array(items))) |
440 | } | 425 | } |