mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Implement goto_declaration support
This commit is contained in:
parent
9239943b84
commit
5a74e93c33
6 changed files with 135 additions and 3 deletions
|
@ -28,6 +28,7 @@ mod expand_macro;
|
|||
mod extend_selection;
|
||||
mod file_structure;
|
||||
mod folding_ranges;
|
||||
mod goto_declaration;
|
||||
mod goto_definition;
|
||||
mod goto_implementation;
|
||||
mod goto_type_definition;
|
||||
|
@ -374,6 +375,14 @@ impl Analysis {
|
|||
self.with_db(|db| goto_definition::goto_definition(db, position))
|
||||
}
|
||||
|
||||
/// Returns the declaration from the symbol at `position`.
|
||||
pub fn goto_declaration(
|
||||
&self,
|
||||
position: FilePosition,
|
||||
) -> Cancellable<Option<RangeInfo<Vec<NavigationTarget>>>> {
|
||||
self.with_db(|db| goto_declaration::goto_declaration(db, position))
|
||||
}
|
||||
|
||||
/// Returns the impls from the symbol at `position`.
|
||||
pub fn goto_implementation(
|
||||
&self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue