aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/lib.rs')
-rw-r--r--crates/ra_ide/src/lib.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs
index 5599f143f..357c01cdf 100644
--- a/crates/ra_ide/src/lib.rs
+++ b/crates/ra_ide/src/lib.rs
@@ -127,6 +127,21 @@ pub struct CallInfo {
127 pub active_parameter: Option<usize>, 127 pub active_parameter: Option<usize>,
128} 128}
129 129
130impl CallInfo {
131 pub fn active_parameter_type(&self) -> Option<String> {
132 if let Some(id) = self.active_parameter {
133 return self.signature.parameter_types.get(id).map(|param_ty| param_ty.clone());
134 }
135 None
136 }
137 pub fn active_parameter_name(&self) -> Option<String> {
138 if let Some(id) = self.active_parameter {
139 return self.signature.parameter_names.get(id).map(|param_ty| param_ty.clone());
140 }
141 None
142 }
143}
144
130/// `AnalysisHost` stores the current state of the world. 145/// `AnalysisHost` stores the current state of the world.
131#[derive(Debug)] 146#[derive(Debug)]
132pub struct AnalysisHost { 147pub struct AnalysisHost {