From 23b040962ff299feeef1f967bc2d5ba92b01c2bc Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 20 Dec 2018 22:13:16 +0300 Subject: fold curly blocks --- crates/ra_lsp_server/src/main_loop/handlers.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/ra_lsp_server') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 572ae7fb5..801966304 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -446,8 +446,9 @@ pub fn handle_folding_range( .into_iter() .map(|fold| { let kind = match fold.kind { - FoldKind::Comment => FoldingRangeKind::Comment, - FoldKind::Imports => FoldingRangeKind::Imports, + FoldKind::Comment => Some(FoldingRangeKind::Comment), + FoldKind::Imports => Some(FoldingRangeKind::Imports), + FoldKind::Block => None, }; let range = fold.range.conv_with(&line_index); FoldingRange { @@ -455,7 +456,7 @@ pub fn handle_folding_range( start_character: Some(range.start.character), end_line: range.end.line, end_character: Some(range.start.character), - kind: Some(kind), + kind, } }) .collect(), -- cgit v1.2.3