diff options
Diffstat (limited to 'crates/ra_ide/src/lib.rs')
-rw-r--r-- | crates/ra_ide/src/lib.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index 779a81b2c..06497617b 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs | |||
@@ -24,6 +24,7 @@ mod goto_definition; | |||
24 | mod goto_type_definition; | 24 | mod goto_type_definition; |
25 | mod extend_selection; | 25 | mod extend_selection; |
26 | mod hover; | 26 | mod hover; |
27 | mod call_hierarchy; | ||
27 | mod call_info; | 28 | mod call_info; |
28 | mod syntax_highlighting; | 29 | mod syntax_highlighting; |
29 | mod parent_module; | 30 | mod parent_module; |
@@ -62,6 +63,7 @@ use crate::{db::LineIndexDatabase, display::ToNav, symbol_index::FileSymbol}; | |||
62 | 63 | ||
63 | pub use crate::{ | 64 | pub use crate::{ |
64 | assists::{Assist, AssistId}, | 65 | assists::{Assist, AssistId}, |
66 | call_hierarchy::CallItem, | ||
65 | change::{AnalysisChange, LibraryData}, | 67 | change::{AnalysisChange, LibraryData}, |
66 | completion::{CompletionItem, CompletionItemKind, InsertTextFormat}, | 68 | completion::{CompletionItem, CompletionItemKind, InsertTextFormat}, |
67 | diagnostics::Severity, | 69 | diagnostics::Severity, |
@@ -412,6 +414,24 @@ impl Analysis { | |||
412 | self.with_db(|db| call_info::call_info(db, position)) | 414 | self.with_db(|db| call_info::call_info(db, position)) |
413 | } | 415 | } |
414 | 416 | ||
417 | /// Computes call hierarchy candidates for the given file position. | ||
418 | pub fn call_hierarchy( | ||
419 | &self, | ||
420 | position: FilePosition, | ||
421 | ) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>> { | ||
422 | self.with_db(|db| call_hierarchy::call_hierarchy(db, position)) | ||
423 | } | ||
424 | |||
425 | /// Computes incoming calls for the given file position. | ||
426 | pub fn incoming_calls(&self, position: FilePosition) -> Cancelable<Option<Vec<CallItem>>> { | ||
427 | self.with_db(|db| call_hierarchy::incoming_calls(db, position)) | ||
428 | } | ||
429 | |||
430 | /// Computes incoming calls for the given file position. | ||
431 | pub fn outgoing_calls(&self, position: FilePosition) -> Cancelable<Option<Vec<CallItem>>> { | ||
432 | self.with_db(|db| call_hierarchy::outgoing_calls(db, position)) | ||
433 | } | ||
434 | |||
415 | /// Returns a `mod name;` declaration which created the current module. | 435 | /// Returns a `mod name;` declaration which created the current module. |
416 | pub fn parent_module(&self, position: FilePosition) -> Cancelable<Vec<NavigationTarget>> { | 436 | pub fn parent_module(&self, position: FilePosition) -> Cancelable<Vec<NavigationTarget>> { |
417 | self.with_db(|db| parent_module::parent_module(db, position)) | 437 | self.with_db(|db| parent_module::parent_module(db, position)) |