Implement goto_declaration support

This commit is contained in:
Lukas Wirth 2021-06-22 20:43:48 +02:00
parent 9239943b84
commit 5a74e93c33
6 changed files with 135 additions and 3 deletions

View file

@ -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,