diff --git a/crates/libeditor/src/typing.rs b/crates/libeditor/src/typing.rs index 48a8d6bb05..2cff96b347 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 17926d5ae4..2be54215a5 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 10b9b64ac6..70af474ae3 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); - } + }; } }