for highlighting, search only the current file

This commit is contained in:
Aleksey Kladov 2019-10-24 14:01:02 +03:00
parent 6d186ec3be
commit 4529da906d
5 changed files with 112 additions and 29 deletions

View file

@ -71,7 +71,7 @@ pub use crate::{
inlay_hints::{InlayHint, InlayKind},
line_index::{LineCol, LineIndex},
line_index_utils::translate_offset_with_edit,
references::ReferenceSearchResult,
references::{ReferenceSearchResult, SearchScope},
runnables::{Runnable, RunnableKind},
syntax_highlighting::HighlightedRange,
};
@ -481,8 +481,9 @@ impl Analysis {
pub fn find_all_refs(
&self,
position: FilePosition,
search_scope: Option<SearchScope>,
) -> Cancelable<Option<ReferenceSearchResult>> {
self.with_db(|db| references::find_all_refs(db, position).map(|it| it.info))
self.with_db(|db| references::find_all_refs(db, position, search_scope).map(|it| it.info))
}
/// Returns a short text describing element at position.