diff options
author | Aleksey Kladov <[email protected]> | 2018-10-25 08:57:55 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-10-25 14:25:40 +0100 |
commit | ee4d904cfb1b604bc8627491e05980ac43cd59e3 (patch) | |
tree | 54d1b937de544b8f6a8f2821ad9599aa82192375 /crates/ra_analysis/src/descriptors/module/mod.rs | |
parent | 2cb2074c4b7219b32993abdcc7084637c0123d49 (diff) |
Store all the data in the Salsa Database
Diffstat (limited to 'crates/ra_analysis/src/descriptors/module/mod.rs')
-rw-r--r-- | crates/ra_analysis/src/descriptors/module/mod.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/mod.rs b/crates/ra_analysis/src/descriptors/module/mod.rs index 52da650b3..98024cc15 100644 --- a/crates/ra_analysis/src/descriptors/module/mod.rs +++ b/crates/ra_analysis/src/descriptors/module/mod.rs | |||
@@ -7,12 +7,12 @@ use ra_syntax::{ast::{self, NameOwner, AstNode}, SmolStr, SyntaxNode}; | |||
7 | 7 | ||
8 | use crate::{ | 8 | use crate::{ |
9 | FileId, Cancelable, | 9 | FileId, Cancelable, |
10 | db::SyntaxDatabase, | 10 | db::{SyntaxDatabase, input::SourceRootId}, |
11 | }; | 11 | }; |
12 | 12 | ||
13 | salsa::query_group! { | 13 | salsa::query_group! { |
14 | pub(crate) trait ModulesDatabase: SyntaxDatabase { | 14 | pub(crate) trait ModulesDatabase: SyntaxDatabase { |
15 | fn module_tree() -> Cancelable<Arc<ModuleTree>> { | 15 | fn module_tree(source_root_id: SourceRootId) -> Cancelable<Arc<ModuleTree>> { |
16 | type ModuleTreeQuery; | 16 | type ModuleTreeQuery; |
17 | use fn imp::module_tree; | 17 | use fn imp::module_tree; |
18 | } | 18 | } |
@@ -110,15 +110,9 @@ impl ModuleId { | |||
110 | } | 110 | } |
111 | 111 | ||
112 | impl LinkId { | 112 | impl LinkId { |
113 | pub(crate) fn name(self, tree: &ModuleTree) -> SmolStr { | ||
114 | tree.link(self).name.clone() | ||
115 | } | ||
116 | pub(crate) fn owner(self, tree: &ModuleTree) -> ModuleId { | 113 | pub(crate) fn owner(self, tree: &ModuleTree) -> ModuleId { |
117 | tree.link(self).owner | 114 | tree.link(self).owner |
118 | } | 115 | } |
119 | fn points_to(self, tree: &ModuleTree) -> &[ModuleId] { | ||
120 | &tree.link(self).points_to | ||
121 | } | ||
122 | pub(crate) fn bind_source<'a>( | 116 | pub(crate) fn bind_source<'a>( |
123 | self, | 117 | self, |
124 | tree: &ModuleTree, | 118 | tree: &ModuleTree, |