From 1874b6738ab4b849e5cbcb37fe2019192f950e5e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 4 Mar 2020 12:06:37 +0100 Subject: Move ReferenceKind --- crates/ra_ide/src/references.rs | 21 +-------------------- crates/ra_ide_db/src/search.rs | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'crates') 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 pub(crate) use self::rename::rename; -pub use ra_ide_db::search::SearchScope; +pub use ra_ide_db::search::{Reference, ReferenceAccess, ReferenceKind, SearchScope}; #[derive(Debug, Clone)] pub struct ReferenceSearchResult { @@ -46,25 +46,6 @@ pub struct Declaration { pub access: Option, } -#[derive(Debug, Clone)] -pub struct Reference { - pub file_range: FileRange, - pub kind: ReferenceKind, - pub access: Option, -} - -#[derive(Debug, Clone, PartialEq)] -pub enum ReferenceKind { - StructLiteral, - Other, -} - -#[derive(Debug, Copy, Clone, PartialEq)] -pub enum ReferenceAccess { - Read, - Write, -} - impl ReferenceSearchResult { pub fn declaration(&self) -> &Declaration { &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 @@ use std::mem; use hir::{DefWithBody, HasSource, ModuleSource}; -use ra_db::{FileId, SourceDatabaseExt}; +use ra_db::{FileId, FileRange, SourceDatabaseExt}; use ra_prof::profile; use ra_syntax::{AstNode, TextRange}; use rustc_hash::FxHashMap; use crate::{defs::Definition, RootDatabase}; +#[derive(Debug, Clone)] +pub struct Reference { + pub file_range: FileRange, + pub kind: ReferenceKind, + pub access: Option, +} + +#[derive(Debug, Clone, PartialEq)] +pub enum ReferenceKind { + StructLiteral, + Other, +} + +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum ReferenceAccess { + Read, + Write, +} + pub struct SearchScope { entries: FxHashMap>, } -- cgit v1.2.3