From 8cc4210278c93b9ccf0f825408d0d32bf68617bd Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 7 Mar 2020 15:47:10 +0100 Subject: Add more tests --- crates/ra_mbe/src/mbe_expander/matcher.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/ra_mbe/src') diff --git a/crates/ra_mbe/src/mbe_expander/matcher.rs b/crates/ra_mbe/src/mbe_expander/matcher.rs index ffba03898..49c53183a 100644 --- a/crates/ra_mbe/src/mbe_expander/matcher.rs +++ b/crates/ra_mbe/src/mbe_expander/matcher.rs @@ -247,6 +247,7 @@ impl<'a> TtIter<'a> { ra_parser::parse_fragment(&mut src, &mut sink, fragment_kind); if !sink.cursor.is_root() || sink.error { + // FIXME better recovery in this case would help completion inside macros immensely return Err(()); } @@ -375,7 +376,8 @@ fn match_meta_var(kind: &str, input: &mut TtIter) -> Result, Ex return Ok(Some(Fragment::Tokens(tt))); } }; - let tt = input.expect_fragment(fragment).map_err(|()| err!())?; + let tt = + input.expect_fragment(fragment).map_err(|()| err!("fragment did not parse as {}", kind))?; let fragment = if kind == "expr" { Fragment::Ast(tt) } else { Fragment::Tokens(tt) }; Ok(Some(fragment)) } -- cgit v1.2.3