aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/lib.rs')
-rw-r--r--crates/ra_ide_api/src/lib.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs
index 51947e4cc..5d8acf9df 100644
--- a/crates/ra_ide_api/src/lib.rs
+++ b/crates/ra_ide_api/src/lib.rs
@@ -25,6 +25,7 @@ mod call_info;
25mod syntax_highlighting; 25mod syntax_highlighting;
26mod parent_module; 26mod parent_module;
27mod rename; 27mod rename;
28mod impls;
28 29
29#[cfg(test)] 30#[cfg(test)]
30mod marks; 31mod marks;
@@ -58,6 +59,7 @@ pub use ra_ide_api_light::{
58pub use ra_db::{ 59pub use ra_db::{
59 Canceled, CrateGraph, CrateId, FileId, FilePosition, FileRange, SourceRootId 60 Canceled, CrateGraph, CrateId, FileId, FilePosition, FileRange, SourceRootId
60}; 61};
62pub use hir::Documentation;
61 63
62// We use jemalloc mainly to get heap usage statistics, actual performance 64// We use jemalloc mainly to get heap usage statistics, actual performance
63// differnece is not measures. 65// differnece is not measures.
@@ -266,7 +268,7 @@ impl<T> RangeInfo<T> {
266#[derive(Debug)] 268#[derive(Debug)]
267pub struct CallInfo { 269pub struct CallInfo {
268 pub label: String, 270 pub label: String,
269 pub doc: Option<String>, 271 pub doc: Option<Documentation>,
270 pub parameters: Vec<String>, 272 pub parameters: Vec<String>,
271 pub active_parameter: Option<usize>, 273 pub active_parameter: Option<usize>,
272} 274}
@@ -415,6 +417,13 @@ impl Analysis {
415 self.with_db(|db| goto_definition::goto_definition(db, position)) 417 self.with_db(|db| goto_definition::goto_definition(db, position))
416 } 418 }
417 419
420 pub fn goto_implementation(
421 &self,
422 position: FilePosition,
423 ) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>> {
424 self.with_db(|db| impls::goto_implementation(db, position))
425 }
426
418 /// Finds all usages of the reference at point. 427 /// Finds all usages of the reference at point.
419 pub fn find_all_refs(&self, position: FilePosition) -> Cancelable<Vec<(FileId, TextRange)>> { 428 pub fn find_all_refs(&self, position: FilePosition) -> Cancelable<Vec<(FileId, TextRange)>> {
420 self.with_db(|db| db.find_all_refs(position)) 429 self.with_db(|db| db.find_all_refs(position))