mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
show local variable types in completion
This commit is contained in:
parent
5f3ff157e3
commit
8e49bb664a
6 changed files with 30 additions and 9 deletions
|
@ -256,6 +256,14 @@ impl SourceAnalyzer {
|
|||
Some(self.infer.as_ref()?[pat_id].clone())
|
||||
}
|
||||
|
||||
pub fn type_of_pat_by_id(
|
||||
&self,
|
||||
_db: &impl HirDatabase,
|
||||
pat_id: expr::PatId,
|
||||
) -> Option<crate::Ty> {
|
||||
Some(self.infer.as_ref()?[pat_id].clone())
|
||||
}
|
||||
|
||||
pub fn resolve_method_call(&self, call: &ast::MethodCallExpr) -> Option<Function> {
|
||||
let expr_id = self.body_source_map.as_ref()?.node_expr(&call.clone().into())?;
|
||||
self.infer.as_ref()?.method_resolution(expr_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue