From 5518a65037f862fc45e72f1256aa4994a6b14a57 Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Sat, 17 Apr 2021 16:39:03 +0200 Subject: Add an error message to fixture errors --- crates/base_db/src/fixture.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates') diff --git a/crates/base_db/src/fixture.rs b/crates/base_db/src/fixture.rs index 04e2be390..30f85bf3a 100644 --- a/crates/base_db/src/fixture.rs +++ b/crates/base_db/src/fixture.rs @@ -54,7 +54,9 @@ pub trait WithFixture: Default + SourceDatabaseExt + 'static { let fixture = ChangeFixture::parse(ra_fixture); let mut db = Self::default(); fixture.change.apply(&mut db); - let (file_id, range_or_offset) = fixture.file_position.unwrap(); + let (file_id, range_or_offset) = fixture + .file_position + .expect("Could not find file position in fixture. Did you forget to add an `$0`?"); (db, file_id, range_or_offset) } -- cgit v1.2.3