Refactor for less laziness (right now)

This commit is contained in:
Ayaz Hafiz 2023-10-22 10:36:03 -04:00
parent 40f297445d
commit e954e074fb
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
6 changed files with 217 additions and 135 deletions

View file

@ -703,6 +703,16 @@ pub enum FoundSymbol {
Symbol(Symbol),
}
impl FoundSymbol {
pub fn implementation_symbol(&self) -> Symbol {
match self {
FoundSymbol::Specialization(_, sym)
| FoundSymbol::AbilityMember(_, sym)
| FoundSymbol::Symbol(sym) => *sym,
}
}
}
/// Given an ability Foo implements foo : ..., returns (T, foo1) if the symbol at the given region is a
/// Like [find_type_at], but descends into the narrowest node containing [position].
pub fn find_closest_type_at(