diff options
author | Aleksey Kladov <[email protected]> | 2018-11-21 13:16:54 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-21 13:16:54 +0000 |
commit | d47075af5275bcf4f22b9c8ab00027f7828d640d (patch) | |
tree | 554c430d8fbfee3c328607524218cdb46c046d9b /crates | |
parent | 8954d4dc67fc3cf519a9855b974846cfcb8c53b2 (diff) |
move path to descriptors
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_analysis/src/descriptors/mod.rs | 16 | ||||
-rw-r--r-- | crates/ra_analysis/src/descriptors/module/nameres.rs | 15 |
2 files changed, 16 insertions, 15 deletions
diff --git a/crates/ra_analysis/src/descriptors/mod.rs b/crates/ra_analysis/src/descriptors/mod.rs index 6b56d92e1..82658211f 100644 --- a/crates/ra_analysis/src/descriptors/mod.rs +++ b/crates/ra_analysis/src/descriptors/mod.rs | |||
@@ -5,7 +5,7 @@ use std::sync::Arc; | |||
5 | 5 | ||
6 | use ra_syntax::{ | 6 | use ra_syntax::{ |
7 | ast::{self, AstNode, FnDefNode}, | 7 | ast::{self, AstNode, FnDefNode}, |
8 | TextRange, | 8 | TextRange, SmolStr, |
9 | }; | 9 | }; |
10 | 10 | ||
11 | use crate::{ | 11 | use crate::{ |
@@ -50,6 +50,20 @@ salsa::query_group! { | |||
50 | } | 50 | } |
51 | } | 51 | } |
52 | 52 | ||
53 | #[derive(Debug, Clone, PartialEq, Eq)] | ||
54 | pub(crate) struct Path { | ||
55 | kind: PathKind, | ||
56 | segments: Vec<SmolStr>, | ||
57 | } | ||
58 | |||
59 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] | ||
60 | pub(crate) enum PathKind { | ||
61 | Abs, | ||
62 | Self_, | ||
63 | Super, | ||
64 | Crate, | ||
65 | } | ||
66 | |||
53 | #[derive(Debug)] | 67 | #[derive(Debug)] |
54 | pub struct ReferenceDescriptor { | 68 | pub struct ReferenceDescriptor { |
55 | pub range: TextRange, | 69 | pub range: TextRange, |
diff --git a/crates/ra_analysis/src/descriptors/module/nameres.rs b/crates/ra_analysis/src/descriptors/module/nameres.rs index fb315a870..16f1bbd1e 100644 --- a/crates/ra_analysis/src/descriptors/module/nameres.rs +++ b/crates/ra_analysis/src/descriptors/module/nameres.rs | |||
@@ -15,6 +15,7 @@ use crate::{ | |||
15 | Cancelable, | 15 | Cancelable, |
16 | loc2id::{DefId, DefLoc}, | 16 | loc2id::{DefId, DefLoc}, |
17 | descriptors::{ | 17 | descriptors::{ |
18 | Path, PathKind, | ||
18 | DescriptorDatabase, | 19 | DescriptorDatabase, |
19 | module::{ModuleId, ModuleTree, ModuleSourceNode}, | 20 | module::{ModuleId, ModuleTree, ModuleSourceNode}, |
20 | }, | 21 | }, |
@@ -59,20 +60,6 @@ enum ImportKind { | |||
59 | Named(LocalSyntaxPtr), | 60 | Named(LocalSyntaxPtr), |
60 | } | 61 | } |
61 | 62 | ||
62 | #[derive(Debug, Clone, PartialEq, Eq)] | ||
63 | struct Path { | ||
64 | kind: PathKind, | ||
65 | segments: Vec<SmolStr>, | ||
66 | } | ||
67 | |||
68 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] | ||
69 | enum PathKind { | ||
70 | Abs, | ||
71 | Self_, | ||
72 | Super, | ||
73 | Crate, | ||
74 | } | ||
75 | |||
76 | pub(crate) fn input_module_items( | 63 | pub(crate) fn input_module_items( |
77 | db: &impl DescriptorDatabase, | 64 | db: &impl DescriptorDatabase, |
78 | source_root: SourceRootId, | 65 | source_root: SourceRootId, |