aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_ide/src/references.rs21
-rw-r--r--crates/ra_ide_db/src/search.rs21
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
32pub(crate) use self::rename::rename; 32pub(crate) use self::rename::rename;
33 33
34pub use ra_ide_db::search::SearchScope; 34pub use ra_ide_db::search::{Reference, ReferenceAccess, ReferenceKind, SearchScope};
35 35
36#[derive(Debug, Clone)] 36#[derive(Debug, Clone)]
37pub struct ReferenceSearchResult { 37pub 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)]
50pub struct Reference {
51 pub file_range: FileRange,
52 pub kind: ReferenceKind,
53 pub access: Option<ReferenceAccess>,
54}
55
56#[derive(Debug, Clone, PartialEq)]
57pub enum ReferenceKind {
58 StructLiteral,
59 Other,
60}
61
62#[derive(Debug, Copy, Clone, PartialEq)]
63pub enum ReferenceAccess {
64 Read,
65 Write,
66}
67
68impl ReferenceSearchResult { 49impl 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 @@
5use std::mem; 5use std::mem;
6 6
7use hir::{DefWithBody, HasSource, ModuleSource}; 7use hir::{DefWithBody, HasSource, ModuleSource};
8use ra_db::{FileId, SourceDatabaseExt}; 8use ra_db::{FileId, FileRange, SourceDatabaseExt};
9use ra_prof::profile; 9use ra_prof::profile;
10use ra_syntax::{AstNode, TextRange}; 10use ra_syntax::{AstNode, TextRange};
11use rustc_hash::FxHashMap; 11use rustc_hash::FxHashMap;
12 12
13use crate::{defs::Definition, RootDatabase}; 13use crate::{defs::Definition, RootDatabase};
14 14
15#[derive(Debug, Clone)]
16pub struct Reference {
17 pub file_range: FileRange,
18 pub kind: ReferenceKind,
19 pub access: Option<ReferenceAccess>,
20}
21
22#[derive(Debug, Clone, PartialEq)]
23pub enum ReferenceKind {
24 StructLiteral,
25 Other,
26}
27
28#[derive(Debug, Copy, Clone, PartialEq)]
29pub enum ReferenceAccess {
30 Read,
31 Write,
32}
33
15pub struct SearchScope { 34pub struct SearchScope {
16 entries: FxHashMap<FileId, Option<TextRange>>, 35 entries: FxHashMap<FileId, Option<TextRange>>,
17} 36}