mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Refactor find_all_refs to return ReferenceSearchResult
This commit is contained in:
parent
edd4c1d8a6
commit
85a6bf3424
6 changed files with 127 additions and 48 deletions
|
@ -56,6 +56,7 @@ pub use crate::{
|
|||
completion::{CompletionItem, CompletionItemKind, InsertTextFormat},
|
||||
runnables::{Runnable, RunnableKind},
|
||||
navigation_target::NavigationTarget,
|
||||
references::ReferenceSearchResult,
|
||||
};
|
||||
pub use ra_ide_api_light::{
|
||||
Fold, FoldKind, HighlightedRange, Severity, StructureNode, LocalEdit,
|
||||
|
@ -319,7 +320,10 @@ impl Analysis {
|
|||
}
|
||||
|
||||
/// Finds all usages of the reference at point.
|
||||
pub fn find_all_refs(&self, position: FilePosition) -> Cancelable<Vec<(FileId, TextRange)>> {
|
||||
pub fn find_all_refs(
|
||||
&self,
|
||||
position: FilePosition,
|
||||
) -> Cancelable<Option<ReferenceSearchResult>> {
|
||||
self.with_db(|db| references::find_all_refs(db, position))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue