mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Add functions to DefId
This commit is contained in:
parent
947e3350e0
commit
d8b0379e10
10 changed files with 90 additions and 83 deletions
|
@ -1,7 +1,7 @@
|
|||
use std::sync::Arc;
|
||||
use salsa::{self, Database};
|
||||
use ra_db::{LocationIntener, BaseDatabase};
|
||||
use hir::{self, DefId, DefLoc, FnId, SourceItemId};
|
||||
use hir::{self, DefId, DefLoc};
|
||||
|
||||
use crate::{
|
||||
symbol_index,
|
||||
|
@ -15,7 +15,6 @@ pub(crate) struct RootDatabase {
|
|||
|
||||
#[derive(Debug, Default)]
|
||||
struct IdMaps {
|
||||
fns: LocationIntener<SourceItemId, FnId>,
|
||||
defs: LocationIntener<DefLoc, DefId>,
|
||||
}
|
||||
|
||||
|
@ -58,12 +57,6 @@ impl AsRef<LocationIntener<DefLoc, DefId>> for RootDatabase {
|
|||
}
|
||||
}
|
||||
|
||||
impl AsRef<LocationIntener<hir::SourceItemId, FnId>> for RootDatabase {
|
||||
fn as_ref(&self) -> &LocationIntener<hir::SourceItemId, FnId> {
|
||||
&self.id_maps.fns
|
||||
}
|
||||
}
|
||||
|
||||
salsa::database_storage! {
|
||||
pub(crate) struct RootDatabaseStorage for RootDatabase {
|
||||
impl ra_db::FilesDatabase {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue