aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_ide_api_light/src/assists/introduce_variable.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_ide_api_light/src/assists/introduce_variable.rs b/crates/ra_ide_api_light/src/assists/introduce_variable.rs
index 310c16960..150baa542 100644
--- a/crates/ra_ide_api_light/src/assists/introduce_variable.rs
+++ b/crates/ra_ide_api_light/src/assists/introduce_variable.rs
@@ -1,6 +1,6 @@
1use ra_syntax::{ 1use ra_syntax::{
2 ast::{self, AstNode}, 2 ast::{self, AstNode},
3 SyntaxKind::WHITESPACE, 3 SyntaxKind::{WHITESPACE, BLOCK_EXPR},
4 SyntaxNode, TextUnit, 4 SyntaxNode, TextUnit,
5}; 5};
6 6
@@ -26,6 +26,9 @@ pub fn introduce_variable<'a>(ctx: AssistCtx) -> Option<Assist> {
26 false 26 false
27 }; 27 };
28 if is_full_stmt { 28 if is_full_stmt {
29 if expr.syntax().kind() == BLOCK_EXPR {
30 buf.push_str(";");
31 }
29 edit.replace(expr.syntax().range(), buf); 32 edit.replace(expr.syntax().range(), buf);
30 } else { 33 } else {
31 buf.push_str(";"); 34 buf.push_str(";");