diff options
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 572ae7fb5..1751d7fa8 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -107,9 +107,16 @@ pub fn handle_on_type_formatting( | |||
107 | }; | 107 | }; |
108 | let edits = match world.analysis().on_eq_typed(position) { | 108 | let edits = match world.analysis().on_eq_typed(position) { |
109 | None => return Ok(None), | 109 | None => return Ok(None), |
110 | Some(mut action) => action.source_file_edits.pop().unwrap().edits, | 110 | Some(mut action) => action |
111 | .source_file_edits | ||
112 | .pop() | ||
113 | .unwrap() | ||
114 | .edit | ||
115 | .as_atoms() | ||
116 | .iter() | ||
117 | .map_conv_with(&line_index) | ||
118 | .collect(), | ||
111 | }; | 119 | }; |
112 | let edits = edits.into_iter().map_conv_with(&line_index).collect(); | ||
113 | Ok(Some(edits)) | 120 | Ok(Some(edits)) |
114 | } | 121 | } |
115 | 122 | ||
@@ -446,8 +453,9 @@ pub fn handle_folding_range( | |||
446 | .into_iter() | 453 | .into_iter() |
447 | .map(|fold| { | 454 | .map(|fold| { |
448 | let kind = match fold.kind { | 455 | let kind = match fold.kind { |
449 | FoldKind::Comment => FoldingRangeKind::Comment, | 456 | FoldKind::Comment => Some(FoldingRangeKind::Comment), |
450 | FoldKind::Imports => FoldingRangeKind::Imports, | 457 | FoldKind::Imports => Some(FoldingRangeKind::Imports), |
458 | FoldKind::Block => None, | ||
451 | }; | 459 | }; |
452 | let range = fold.range.conv_with(&line_index); | 460 | let range = fold.range.conv_with(&line_index); |
453 | FoldingRange { | 461 | FoldingRange { |
@@ -455,7 +463,7 @@ pub fn handle_folding_range( | |||
455 | start_character: Some(range.start.character), | 463 | start_character: Some(range.start.character), |
456 | end_line: range.end.line, | 464 | end_line: range.end.line, |
457 | end_character: Some(range.start.character), | 465 | end_character: Some(range.start.character), |
458 | kind: Some(kind), | 466 | kind, |
459 | } | 467 | } |
460 | }) | 468 | }) |
461 | .collect(), | 469 | .collect(), |