mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Add functions to DefId
This commit is contained in:
parent
947e3350e0
commit
d8b0379e10
10 changed files with 90 additions and 83 deletions
|
@ -6,7 +6,7 @@ use ra_db::{LocationIntener, BaseDatabase, FilePosition, mock::FileMap, FileId,
|
|||
use relative_path::RelativePathBuf;
|
||||
use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset};
|
||||
|
||||
use crate::{db, DefId, DefLoc, FnId, SourceItemId};
|
||||
use crate::{db, DefId, DefLoc};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct MockDatabase {
|
||||
|
@ -65,7 +65,6 @@ impl MockDatabase {
|
|||
|
||||
#[derive(Debug, Default)]
|
||||
struct IdMaps {
|
||||
fns: LocationIntener<SourceItemId, FnId>,
|
||||
defs: LocationIntener<DefLoc, DefId>,
|
||||
}
|
||||
|
||||
|
@ -117,12 +116,6 @@ impl AsRef<LocationIntener<DefLoc, DefId>> for MockDatabase {
|
|||
}
|
||||
}
|
||||
|
||||
impl AsRef<LocationIntener<SourceItemId, FnId>> for MockDatabase {
|
||||
fn as_ref(&self) -> &LocationIntener<SourceItemId, FnId> {
|
||||
&self.id_maps.fns
|
||||
}
|
||||
}
|
||||
|
||||
impl MockDatabase {
|
||||
pub(crate) fn log(&self, f: impl FnOnce()) -> Vec<salsa::Event<MockDatabase>> {
|
||||
*self.events.lock() = Some(Vec::new());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue