aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/join_lines.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-09-02 20:20:24 +0100
committerGitHub <[email protected]>2019-09-02 20:20:24 +0100
commit7faec1c30046769d4ae490e15cf5405bcfbdeef8 (patch)
tree6d268b721027a5350928a6c5a0ec227b5fde8ebc /crates/ra_ide_api/src/join_lines.rs
parenta8397deab914240aca8f015fb3736689919c0a5b (diff)
parente94587e3153b52684fd3f6b82c8e7efc09ff5c8d (diff)
Merge #1752
1752: Always wrap blocks into block expressions r=flodiebold a=matklad This way, things like function bodies are expressions, and we don't have to single them out Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/join_lines.rs')
-rw-r--r--crates/ra_ide_api/src/join_lines.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/join_lines.rs b/crates/ra_ide_api/src/join_lines.rs
index a2e4b6f3c..a71e4ed7d 100644
--- a/crates/ra_ide_api/src/join_lines.rs
+++ b/crates/ra_ide_api/src/join_lines.rs
@@ -123,7 +123,7 @@ fn has_comma_after(node: &SyntaxNode) -> bool {
123fn join_single_expr_block(edit: &mut TextEditBuilder, token: &SyntaxToken) -> Option<()> { 123fn join_single_expr_block(edit: &mut TextEditBuilder, token: &SyntaxToken) -> Option<()> {
124 let block = ast::Block::cast(token.parent())?; 124 let block = ast::Block::cast(token.parent())?;
125 let block_expr = ast::BlockExpr::cast(block.syntax().parent()?)?; 125 let block_expr = ast::BlockExpr::cast(block.syntax().parent()?)?;
126 let expr = extract_trivial_expression(&block)?; 126 let expr = extract_trivial_expression(&block_expr)?;
127 127
128 let block_range = block_expr.syntax().text_range(); 128 let block_range = block_expr.syntax().text_range();
129 let mut buf = expr.syntax().text().to_string(); 129 let mut buf = expr.syntax().text().to_string();