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.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs
index 5599f143f..ddaa30a16 100644
--- a/crates/ra_ide/src/lib.rs
+++ b/crates/ra_ide/src/lib.rs
@@ -67,7 +67,9 @@ use crate::display::ToNav;
67pub use crate::{ 67pub use crate::{
68 assists::{Assist, AssistId}, 68 assists::{Assist, AssistId},
69 call_hierarchy::CallItem, 69 call_hierarchy::CallItem,
70 completion::{CompletionConfig, CompletionItem, CompletionItemKind, InsertTextFormat}, 70 completion::{
71 CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat,
72 },
71 diagnostics::Severity, 73 diagnostics::Severity,
72 display::{file_structure, FunctionSignature, NavigationTarget, StructureNode}, 74 display::{file_structure, FunctionSignature, NavigationTarget, StructureNode},
73 expand_macro::ExpandedMacro, 75 expand_macro::ExpandedMacro,
@@ -127,6 +129,21 @@ pub struct CallInfo {
127 pub active_parameter: Option<usize>, 129 pub active_parameter: Option<usize>,
128} 130}
129 131
132impl CallInfo {
133 pub fn active_parameter_type(&self) -> Option<String> {
134 if let Some(id) = self.active_parameter {
135 return self.signature.parameter_types.get(id).map(|param_ty| param_ty.clone());
136 }
137 None
138 }
139 pub fn active_parameter_name(&self) -> Option<String> {
140 if let Some(id) = self.active_parameter {
141 return self.signature.parameter_names.get(id).map(|param_ty| param_ty.clone());
142 }
143 None
144 }
145}
146
130/// `AnalysisHost` stores the current state of the world. 147/// `AnalysisHost` stores the current state of the world.
131#[derive(Debug)] 148#[derive(Debug)]
132pub struct AnalysisHost { 149pub struct AnalysisHost {