aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorYerkebulan Tulibergenov <[email protected]>2019-01-14 02:22:53 +0000
committerYerkebulan Tulibergenov <[email protected]>2019-01-14 02:22:53 +0000
commit5d6cf59f608228ff6c50dedf1c7b32323b835e11 (patch)
treeb7d685f78467e4abdbe2b408f000beb1afa5c98b /crates
parent1538ca3ae5d99c93c1098261bdd0fdd30f67a278 (diff)
add semicolon for block expr in introduce_variable
Diffstat (limited to 'crates')
-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(";");