diff options
Diffstat (limited to 'crates/ra_ide_db/src/search.rs')
-rw-r--r-- | crates/ra_ide_db/src/search.rs | 21 |
1 files changed, 20 insertions, 1 deletions
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 | } |