feat: respect references.exclude_tests in call-hierarchy

This commit is contained in:
roife 2024-10-13 04:43:53 +08:00
parent d7628c0a8b
commit b7ed8150a3
6 changed files with 141 additions and 20 deletions

View file

@ -79,7 +79,7 @@ use crate::navigation_target::ToNav;
pub use crate::{
annotations::{Annotation, AnnotationConfig, AnnotationKind, AnnotationLocation},
call_hierarchy::CallItem,
call_hierarchy::{CallHierarchyConfig, CallItem},
expand_macro::ExpandedMacro,
file_structure::{StructureNode, StructureNodeKind},
folding_ranges::{Fold, FoldKind},
@ -564,13 +564,21 @@ impl Analysis {
}
/// Computes incoming calls for the given file position.
pub fn incoming_calls(&self, position: FilePosition) -> Cancellable<Option<Vec<CallItem>>> {
self.with_db(|db| call_hierarchy::incoming_calls(db, position))
pub fn incoming_calls(
&self,
config: CallHierarchyConfig,
position: FilePosition,
) -> Cancellable<Option<Vec<CallItem>>> {
self.with_db(|db| call_hierarchy::incoming_calls(db, config, position))
}
/// Computes outgoing calls for the given file position.
pub fn outgoing_calls(&self, position: FilePosition) -> Cancellable<Option<Vec<CallItem>>> {
self.with_db(|db| call_hierarchy::outgoing_calls(db, position))
pub fn outgoing_calls(
&self,
config: CallHierarchyConfig,
position: FilePosition,
) -> Cancellable<Option<Vec<CallItem>>> {
self.with_db(|db| call_hierarchy::outgoing_calls(db, config, position))
}
/// Returns a `mod name;` declaration which created the current module.