diff options
Diffstat (limited to 'crates/ra_analysis/src/call_info.rs')
-rw-r--r-- | crates/ra_analysis/src/call_info.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/call_info.rs b/crates/ra_analysis/src/call_info.rs index a31a54ef6..8da19a648 100644 --- a/crates/ra_analysis/src/call_info.rs +++ b/crates/ra_analysis/src/call_info.rs | |||
@@ -7,10 +7,21 @@ use ra_syntax::{ | |||
7 | use ra_editor::find_node_at_offset; | 7 | use ra_editor::find_node_at_offset; |
8 | use hir::FnSignatureInfo; | 8 | use hir::FnSignatureInfo; |
9 | 9 | ||
10 | use crate::{FilePosition, db::RootDatabase}; | 10 | use crate::{FilePosition, CallInfo, db::RootDatabase}; |
11 | |||
12 | pub(crate) fn call_info(db: &RootDatabase, position: FilePosition) -> Cancelable<Option<CallInfo>> { | ||
13 | let (sig_info, active_parameter) = ctry!(call_info_(db, position)?); | ||
14 | let res = CallInfo { | ||
15 | label: sig_info.label, | ||
16 | doc: sig_info.doc, | ||
17 | parameters: sig_info.params, | ||
18 | active_parameter, | ||
19 | }; | ||
20 | Ok(Some(res)) | ||
21 | } | ||
11 | 22 | ||
12 | /// Computes parameter information for the given call expression. | 23 | /// Computes parameter information for the given call expression. |
13 | pub(crate) fn call_info( | 24 | fn call_info_( |
14 | db: &RootDatabase, | 25 | db: &RootDatabase, |
15 | position: FilePosition, | 26 | position: FilePosition, |
16 | ) -> Cancelable<Option<(FnSignatureInfo, Option<usize>)>> { | 27 | ) -> Cancelable<Option<(FnSignatureInfo, Option<usize>)>> { |