mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
resolve range patterns to the their struct types
This commit is contained in:
parent
2f6923b844
commit
271f64f94d
4 changed files with 141 additions and 8 deletions
|
@ -203,6 +203,10 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> {
|
|||
self.imp.descend_node_at_offset(node, offset).filter_map(|mut it| it.find_map(N::cast))
|
||||
}
|
||||
|
||||
pub fn resolve_range_pat(&self, range_pat: &ast::RangePat) -> Option<Struct> {
|
||||
self.imp.resolve_range_pat(range_pat).map(Struct::from)
|
||||
}
|
||||
|
||||
pub fn resolve_range_expr(&self, range_expr: &ast::RangeExpr) -> Option<Struct> {
|
||||
self.imp.resolve_range_expr(range_expr).map(Struct::from)
|
||||
}
|
||||
|
@ -1361,6 +1365,10 @@ impl<'db> SemanticsImpl<'db> {
|
|||
self.analyze(call.syntax())?.resolve_method_call_fallback(self.db, call)
|
||||
}
|
||||
|
||||
fn resolve_range_pat(&self, range_pat: &ast::RangePat) -> Option<StructId> {
|
||||
self.analyze(range_pat.syntax())?.resolve_range_pat(self.db, range_pat)
|
||||
}
|
||||
|
||||
fn resolve_range_expr(&self, range_expr: &ast::RangeExpr) -> Option<StructId> {
|
||||
self.analyze(range_expr.syntax())?.resolve_range_expr(self.db, range_expr)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue