From 363f466627db373fab23d1df94b7382223b8675a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 Aug 2018 11:17:08 +0300 Subject: tone down on eq typed --- crates/libeditor/src/typing.rs | 2 ++ crates/libeditor/tests/test.rs | 18 +++++++++--------- crates/libsyntax2/src/parser_api.rs | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/crates/libeditor/src/typing.rs b/crates/libeditor/src/typing.rs index 48a8d6bb0..2cff96b34 100644 --- a/crates/libeditor/src/typing.rs +++ b/crates/libeditor/src/typing.rs @@ -66,6 +66,8 @@ pub fn on_eq_typed(file: &File, offset: TextUnit) -> Option { if contains_offset_nonstrict(expr_range, offset) && offset != expr_range.start() { return None; } + } else { + return None; } let offset = let_stmt.syntax().range().end(); let mut edit = EditBuilder::new(); diff --git a/crates/libeditor/tests/test.rs b/crates/libeditor/tests/test.rs index 17926d5ae..2be54215a 100644 --- a/crates/libeditor/tests/test.rs +++ b/crates/libeditor/tests/test.rs @@ -266,15 +266,15 @@ fn test_on_eq_typed() { assert_eq_text!(after, &actual); } - do_check(r" -fn foo() { - let foo =<|> -} -", r" -fn foo() { - let foo =; -} -"); +// do_check(r" +// fn foo() { +// let foo =<|> +// } +// ", r" +// fn foo() { +// let foo =; +// } +// "); do_check(r" fn foo() { let foo =<|> 1 + 1 diff --git a/crates/libsyntax2/src/parser_api.rs b/crates/libsyntax2/src/parser_api.rs index 10b9b64ac..70af474ae 100644 --- a/crates/libsyntax2/src/parser_api.rs +++ b/crates/libsyntax2/src/parser_api.rs @@ -155,7 +155,7 @@ impl<'t> Parser<'t> { self.error(message); self.bump(); m.complete(self, ERROR); - } + }; } } -- cgit v1.2.3