diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_ide/src/references.rs | 21 | ||||
-rw-r--r-- | crates/ra_ide_db/src/search.rs | 21 |
2 files changed, 21 insertions, 21 deletions
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index 6fd46c52d..c797918b0 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs | |||
@@ -31,7 +31,7 @@ use crate::{display::TryToNav, FilePosition, FileRange, NavigationTarget, RangeI | |||
31 | 31 | ||
32 | pub(crate) use self::rename::rename; | 32 | pub(crate) use self::rename::rename; |
33 | 33 | ||
34 | pub use ra_ide_db::search::SearchScope; | 34 | pub use ra_ide_db::search::{Reference, ReferenceAccess, ReferenceKind, SearchScope}; |
35 | 35 | ||
36 | #[derive(Debug, Clone)] | 36 | #[derive(Debug, Clone)] |
37 | pub struct ReferenceSearchResult { | 37 | pub struct ReferenceSearchResult { |
@@ -46,25 +46,6 @@ pub struct Declaration { | |||
46 | pub access: Option<ReferenceAccess>, | 46 | pub access: Option<ReferenceAccess>, |
47 | } | 47 | } |
48 | 48 | ||
49 | #[derive(Debug, Clone)] | ||
50 | pub struct Reference { | ||
51 | pub file_range: FileRange, | ||
52 | pub kind: ReferenceKind, | ||
53 | pub access: Option<ReferenceAccess>, | ||
54 | } | ||
55 | |||
56 | #[derive(Debug, Clone, PartialEq)] | ||
57 | pub enum ReferenceKind { | ||
58 | StructLiteral, | ||
59 | Other, | ||
60 | } | ||
61 | |||
62 | #[derive(Debug, Copy, Clone, PartialEq)] | ||
63 | pub enum ReferenceAccess { | ||
64 | Read, | ||
65 | Write, | ||
66 | } | ||
67 | |||
68 | impl ReferenceSearchResult { | 49 | impl ReferenceSearchResult { |
69 | pub fn declaration(&self) -> &Declaration { | 50 | pub fn declaration(&self) -> &Declaration { |
70 | &self.declaration | 51 | &self.declaration |
diff --git a/crates/ra_ide_db/src/search.rs b/crates/ra_ide_db/src/search.rs index add63b870..ca458388c 100644 --- a/crates/ra_ide_db/src/search.rs +++ b/crates/ra_ide_db/src/search.rs | |||
@@ -5,13 +5,32 @@ | |||
5 | use std::mem; | 5 | use std::mem; |
6 | 6 | ||
7 | use hir::{DefWithBody, HasSource, ModuleSource}; | 7 | use hir::{DefWithBody, HasSource, ModuleSource}; |
8 | use ra_db::{FileId, SourceDatabaseExt}; | 8 | use ra_db::{FileId, FileRange, SourceDatabaseExt}; |
9 | use ra_prof::profile; | 9 | use ra_prof::profile; |
10 | use ra_syntax::{AstNode, TextRange}; | 10 | use ra_syntax::{AstNode, TextRange}; |
11 | use rustc_hash::FxHashMap; | 11 | use rustc_hash::FxHashMap; |
12 | 12 | ||
13 | use crate::{defs::Definition, RootDatabase}; | 13 | use crate::{defs::Definition, RootDatabase}; |
14 | 14 | ||
15 | #[derive(Debug, Clone)] | ||
16 | pub struct Reference { | ||
17 | pub file_range: FileRange, | ||
18 | pub kind: ReferenceKind, | ||
19 | pub access: Option<ReferenceAccess>, | ||
20 | } | ||
21 | |||
22 | #[derive(Debug, Clone, PartialEq)] | ||
23 | pub enum ReferenceKind { | ||
24 | StructLiteral, | ||
25 | Other, | ||
26 | } | ||
27 | |||
28 | #[derive(Debug, Copy, Clone, PartialEq)] | ||
29 | pub enum ReferenceAccess { | ||
30 | Read, | ||
31 | Write, | ||
32 | } | ||
33 | |||
15 | pub struct SearchScope { | 34 | pub struct SearchScope { |
16 | entries: FxHashMap<FileId, Option<TextRange>>, | 35 | entries: FxHashMap<FileId, Option<TextRange>>, |
17 | } | 36 | } |