diff options
Diffstat (limited to 'crates/libeditor')
-rw-r--r-- | crates/libeditor/src/typing.rs | 2 | ||||
-rw-r--r-- | crates/libeditor/tests/test.rs | 18 |
2 files changed, 11 insertions, 9 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<ActionResult> { | |||
66 | if contains_offset_nonstrict(expr_range, offset) && offset != expr_range.start() { | 66 | if contains_offset_nonstrict(expr_range, offset) && offset != expr_range.start() { |
67 | return None; | 67 | return None; |
68 | } | 68 | } |
69 | } else { | ||
70 | return None; | ||
69 | } | 71 | } |
70 | let offset = let_stmt.syntax().range().end(); | 72 | let offset = let_stmt.syntax().range().end(); |
71 | let mut edit = EditBuilder::new(); | 73 | 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() { | |||
266 | assert_eq_text!(after, &actual); | 266 | assert_eq_text!(after, &actual); |
267 | } | 267 | } |
268 | 268 | ||
269 | do_check(r" | 269 | // do_check(r" |
270 | fn foo() { | 270 | // fn foo() { |
271 | let foo =<|> | 271 | // let foo =<|> |
272 | } | 272 | // } |
273 | ", r" | 273 | // ", r" |
274 | fn foo() { | 274 | // fn foo() { |
275 | let foo =; | 275 | // let foo =; |
276 | } | 276 | // } |
277 | "); | 277 | // "); |
278 | do_check(r" | 278 | do_check(r" |
279 | fn foo() { | 279 | fn foo() { |
280 | let foo =<|> 1 + 1 | 280 | let foo =<|> 1 + 1 |