mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Improve autocompletion by looking on the type and name
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
This commit is contained in:
parent
c1317d6923
commit
d42346fed6
6 changed files with 194 additions and 30 deletions
|
@ -127,6 +127,21 @@ pub struct CallInfo {
|
|||
pub active_parameter: Option<usize>,
|
||||
}
|
||||
|
||||
impl CallInfo {
|
||||
pub fn active_parameter_type(&self) -> Option<String> {
|
||||
if let Some(id) = self.active_parameter {
|
||||
return self.signature.parameter_types.get(id).map(|param_ty| param_ty.clone());
|
||||
}
|
||||
None
|
||||
}
|
||||
pub fn active_parameter_name(&self) -> Option<String> {
|
||||
if let Some(id) = self.active_parameter {
|
||||
return self.signature.parameter_names.get(id).map(|param_ty| param_ty.clone());
|
||||
}
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// `AnalysisHost` stores the current state of the world.
|
||||
#[derive(Debug)]
|
||||
pub struct AnalysisHost {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue