From 5d6cf59f608228ff6c50dedf1c7b32323b835e11 Mon Sep 17 00:00:00 2001 From: Yerkebulan Tulibergenov Date: Sun, 13 Jan 2019 18:22:53 -0800 Subject: add semicolon for block expr in introduce_variable --- crates/ra_ide_api_light/src/assists/introduce_variable.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates') 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 @@ use ra_syntax::{ ast::{self, AstNode}, - SyntaxKind::WHITESPACE, + SyntaxKind::{WHITESPACE, BLOCK_EXPR}, SyntaxNode, TextUnit, }; @@ -26,6 +26,9 @@ pub fn introduce_variable<'a>(ctx: AssistCtx) -> Option { false }; if is_full_stmt { + if expr.syntax().kind() == BLOCK_EXPR { + buf.push_str(";"); + } edit.replace(expr.syntax().range(), buf); } else { buf.push_str(";"); -- cgit v1.2.3