mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Add an error message to fixture errors
This commit is contained in:
parent
fb2d284f28
commit
5518a65037
1 changed files with 3 additions and 1 deletions
|
@ -54,7 +54,9 @@ pub trait WithFixture: Default + SourceDatabaseExt + 'static {
|
||||||
let fixture = ChangeFixture::parse(ra_fixture);
|
let fixture = ChangeFixture::parse(ra_fixture);
|
||||||
let mut db = Self::default();
|
let mut db = Self::default();
|
||||||
fixture.change.apply(&mut db);
|
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)
|
(db, file_id, range_or_offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue