aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-28 09:17:08 +0100
committerAleksey Kladov <[email protected]>2018-08-28 09:17:08 +0100
commit363f466627db373fab23d1df94b7382223b8675a (patch)
treef22c779cf90096968488c7951c803f053473f11d
parent2fa90e736b026ee979d9eb59178dc1f792228250 (diff)
tone down on eq typed
-rw-r--r--crates/libeditor/src/typing.rs2
-rw-r--r--crates/libeditor/tests/test.rs18
-rw-r--r--crates/libsyntax2/src/parser_api.rs2
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<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"
270fn foo() { 270// fn foo() {
271 let foo =<|> 271// let foo =<|>
272} 272// }
273", r" 273// ", r"
274fn foo() { 274// fn foo() {
275 let foo =; 275// let foo =;
276} 276// }
277"); 277// ");
278 do_check(r" 278 do_check(r"
279fn foo() { 279fn foo() {
280 let foo =<|> 1 + 1 280 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> {
155 self.error(message); 155 self.error(message);
156 self.bump(); 156 self.bump();
157 m.complete(self, ERROR); 157 m.complete(self, ERROR);
158 } 158 };
159 } 159 }
160} 160}
161 161