aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-04 11:48:50 +0000
committerAleksey Kladov <[email protected]>2020-03-04 11:48:50 +0000
commit4f50a3718762c9272b1929162ce62415a75eec8f (patch)
treea8e5e91aeef1d910a77ed2b664cd28e6d033de7a /crates
parent98d68fa6beec87020b89d01c060288794dc948f1 (diff)
Fix docs
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_ide_db/src/search.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/crates/ra_ide_db/src/search.rs b/crates/ra_ide_db/src/search.rs
index 7bd99d4cc..6f198df04 100644
--- a/crates/ra_ide_db/src/search.rs
+++ b/crates/ra_ide_db/src/search.rs
@@ -1,7 +1,9 @@
1//! Generally, `search_scope` returns files that might contain references for the element. 1//! Implementation of find-usages functionality.
2//! For `pub(crate)` things it's a crate, for `pub` things it's a crate and dependant crates. 2//!
3//! In some cases, the location of the references is known to within a `TextRange`, 3//! It is based on the standard ide trick: first, we run a fast text search to
4//! e.g. for things like local variables. 4//! get a super-set of matches. Then, we we confirm each match using precise
5//! name resolution.
6
5use std::mem; 7use std::mem;
6 8
7use hir::{DefWithBody, HasSource, ModuleSource, Semantics}; 9use hir::{DefWithBody, HasSource, ModuleSource, Semantics};
@@ -38,6 +40,10 @@ pub enum ReferenceAccess {
38 Write, 40 Write,
39} 41}
40 42
43/// Generally, `search_scope` returns files that might contain references for the element.
44/// For `pub(crate)` things it's a crate, for `pub` things it's a crate and dependant crates.
45/// In some cases, the location of the references is known to within a `TextRange`,
46/// e.g. for things like local variables.
41pub struct SearchScope { 47pub struct SearchScope {
42 entries: FxHashMap<FileId, Option<TextRange>>, 48 entries: FxHashMap<FileId, Option<TextRange>>,
43} 49}