mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
move goto_defenition to a separate file
This commit is contained in:
parent
4551155073
commit
c2a0f5e50f
3 changed files with 90 additions and 10 deletions
|
@ -15,6 +15,7 @@ macro_rules! ctry {
|
|||
mod db;
|
||||
mod imp;
|
||||
mod completion;
|
||||
mod goto_defenition;
|
||||
mod symbol_index;
|
||||
pub mod mock_analysis;
|
||||
mod runnables;
|
||||
|
@ -396,16 +397,15 @@ impl Analysis {
|
|||
&self,
|
||||
position: FilePosition,
|
||||
) -> Cancelable<Option<Vec<NavigationTarget>>> {
|
||||
let r = self.approximately_resolve_symbol(position)?;
|
||||
Ok(r.map(|it| it.resolves_to))
|
||||
}
|
||||
/// Resolves reference to definition, but does not gurantee correctness.
|
||||
pub fn approximately_resolve_symbol(
|
||||
&self,
|
||||
position: FilePosition,
|
||||
) -> Cancelable<Option<ReferenceResolution>> {
|
||||
self.db.approximately_resolve_symbol(position)
|
||||
goto_defenition::goto_defenition(&*self.db, position)
|
||||
}
|
||||
// /// Resolves reference to definition, but does not gurantee correctness.
|
||||
// pub fn approximately_resolve_symbol(
|
||||
// &self,
|
||||
// position: FilePosition,
|
||||
// ) -> Cancelable<Option<ReferenceResolution>> {
|
||||
// self.db.approximately_resolve_symbol(position)
|
||||
// }
|
||||
/// Finds all usages of the reference at point.
|
||||
pub fn find_all_refs(&self, position: FilePosition) -> Cancelable<Vec<(FileId, TextRange)>> {
|
||||
self.db.find_all_refs(position)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue