mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Store all the data in the Salsa Database
This commit is contained in:
parent
2cb2074c4b
commit
ee4d904cfb
11 changed files with 337 additions and 199 deletions
|
@ -7,12 +7,12 @@ use ra_syntax::{ast::{self, NameOwner, AstNode}, SmolStr, SyntaxNode};
|
|||
|
||||
use crate::{
|
||||
FileId, Cancelable,
|
||||
db::SyntaxDatabase,
|
||||
db::{SyntaxDatabase, input::SourceRootId},
|
||||
};
|
||||
|
||||
salsa::query_group! {
|
||||
pub(crate) trait ModulesDatabase: SyntaxDatabase {
|
||||
fn module_tree() -> Cancelable<Arc<ModuleTree>> {
|
||||
fn module_tree(source_root_id: SourceRootId) -> Cancelable<Arc<ModuleTree>> {
|
||||
type ModuleTreeQuery;
|
||||
use fn imp::module_tree;
|
||||
}
|
||||
|
@ -110,15 +110,9 @@ impl ModuleId {
|
|||
}
|
||||
|
||||
impl LinkId {
|
||||
pub(crate) fn name(self, tree: &ModuleTree) -> SmolStr {
|
||||
tree.link(self).name.clone()
|
||||
}
|
||||
pub(crate) fn owner(self, tree: &ModuleTree) -> ModuleId {
|
||||
tree.link(self).owner
|
||||
}
|
||||
fn points_to(self, tree: &ModuleTree) -> &[ModuleId] {
|
||||
&tree.link(self).points_to
|
||||
}
|
||||
pub(crate) fn bind_source<'a>(
|
||||
self,
|
||||
tree: &ModuleTree,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue