diff options
author | Aleksey Kladov <[email protected]> | 2018-10-31 07:56:31 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-10-31 07:56:31 +0000 |
commit | b67295134bf5c518b39bc88abbe1bc5b9d7d3baf (patch) | |
tree | a507432668deef7b216cb7c6360620619e904060 /crates/ra_analysis/src/descriptors/module/mod.rs | |
parent | 3068af79ffd23656ff2d46ac92d9192ce6c813fb (diff) |
Move FnDescriptors to analyzer
Diffstat (limited to 'crates/ra_analysis/src/descriptors/module/mod.rs')
-rw-r--r-- | crates/ra_analysis/src/descriptors/module/mod.rs | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/mod.rs b/crates/ra_analysis/src/descriptors/module/mod.rs index 9e5d73f94..667553f74 100644 --- a/crates/ra_analysis/src/descriptors/module/mod.rs +++ b/crates/ra_analysis/src/descriptors/module/mod.rs | |||
@@ -1,37 +1,13 @@ | |||
1 | mod imp; | 1 | pub(super) mod imp; |
2 | pub(crate) mod scope; | 2 | pub(crate) mod scope; |
3 | 3 | ||
4 | use std::sync::Arc; | ||
5 | |||
6 | use relative_path::RelativePathBuf; | 4 | use relative_path::RelativePathBuf; |
7 | use ra_syntax::{ast::{self, NameOwner, AstNode}, SmolStr, SyntaxNode}; | 5 | use ra_syntax::{ast::{self, NameOwner, AstNode}, SmolStr, SyntaxNode}; |
8 | 6 | ||
9 | use crate::{ | 7 | use crate::FileId; |
10 | FileId, Cancelable, | ||
11 | db::SyntaxDatabase, | ||
12 | input::SourceRootId, | ||
13 | }; | ||
14 | 8 | ||
15 | pub(crate) use self::scope::ModuleScope; | 9 | pub(crate) use self::scope::ModuleScope; |
16 | 10 | ||
17 | salsa::query_group! { | ||
18 | pub(crate) trait ModulesDatabase: SyntaxDatabase { | ||
19 | fn module_tree(source_root_id: SourceRootId) -> Cancelable<Arc<ModuleTree>> { | ||
20 | type ModuleTreeQuery; | ||
21 | use fn imp::module_tree; | ||
22 | } | ||
23 | fn submodules(file_id: FileId) -> Cancelable<Arc<Vec<SmolStr>>> { | ||
24 | type SubmodulesQuery; | ||
25 | use fn imp::submodules; | ||
26 | } | ||
27 | fn module_scope(source_root_id: SourceRootId, module_id: ModuleId) -> Cancelable<Arc<ModuleScope>> { | ||
28 | type ModuleScopeQuery; | ||
29 | use fn imp::module_scope; | ||
30 | } | ||
31 | } | ||
32 | } | ||
33 | |||
34 | |||
35 | #[derive(Debug, PartialEq, Eq, Hash)] | 11 | #[derive(Debug, PartialEq, Eq, Hash)] |
36 | pub(crate) struct ModuleTree { | 12 | pub(crate) struct ModuleTree { |
37 | mods: Vec<ModuleData>, | 13 | mods: Vec<ModuleData>, |