diff options
author | Aleksey Kladov <[email protected]> | 2019-01-08 15:27:44 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-08 15:27:44 +0000 |
commit | 256ec6e8d4ac46b2569713d2ffe92d102595f5d2 (patch) | |
tree | d28e4a31ff14549d6495f5fa307174d3884a0a08 /crates/ra_analysis/src/lib.rs | |
parent | e6a4383bb475b866b67df6bb83ecbdf823d73667 (diff) |
introduce CallInfo
Diffstat (limited to 'crates/ra_analysis/src/lib.rs')
-rw-r--r-- | crates/ra_analysis/src/lib.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index 9192f66e8..4fa6750aa 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs | |||
@@ -273,6 +273,14 @@ impl<T> RangeInfo<T> { | |||
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | ||
276 | #[derive(Debug)] | ||
277 | pub struct CallInfo { | ||
278 | pub label: String, | ||
279 | pub doc: Option<String>, | ||
280 | pub parameters: Vec<String>, | ||
281 | pub active_parameter: Option<usize>, | ||
282 | } | ||
283 | |||
276 | /// `AnalysisHost` stores the current state of the world. | 284 | /// `AnalysisHost` stores the current state of the world. |
277 | #[derive(Debug, Default)] | 285 | #[derive(Debug, Default)] |
278 | pub struct AnalysisHost { | 286 | pub struct AnalysisHost { |
@@ -393,10 +401,7 @@ impl Analysis { | |||
393 | hover::hover(&*self.db, position) | 401 | hover::hover(&*self.db, position) |
394 | } | 402 | } |
395 | /// Computes parameter information for the given call expression. | 403 | /// Computes parameter information for the given call expression. |
396 | pub fn call_info( | 404 | pub fn call_info(&self, position: FilePosition) -> Cancelable<Option<CallInfo>> { |
397 | &self, | ||
398 | position: FilePosition, | ||
399 | ) -> Cancelable<Option<(FnSignatureInfo, Option<usize>)>> { | ||
400 | call_info::call_info(&*self.db, position) | 405 | call_info::call_info(&*self.db, position) |
401 | } | 406 | } |
402 | /// Returns a `mod name;` declaration which created the current module. | 407 | /// Returns a `mod name;` declaration which created the current module. |