mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Move ReferenceKind
This commit is contained in:
parent
a549da7e3e
commit
1874b6738a
2 changed files with 21 additions and 21 deletions
|
@ -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<ReferenceAccess>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Reference {
|
||||
pub file_range: FileRange,
|
||||
pub kind: ReferenceKind,
|
||||
pub access: Option<ReferenceAccess>,
|
||||
}
|
||||
|
||||
#[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
|
||||
|
|
|
@ -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<ReferenceAccess>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum ReferenceKind {
|
||||
StructLiteral,
|
||||
Other,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
pub enum ReferenceAccess {
|
||||
Read,
|
||||
Write,
|
||||
}
|
||||
|
||||
pub struct SearchScope {
|
||||
entries: FxHashMap<FileId, Option<TextRange>>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue