feat: implement hover on when clause patterns
This commit is contained in:
parent
f7dd2de17b
commit
a46a7e82b7
|
@ -1169,8 +1169,10 @@ impl TypedClause {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn find_node(&self, byte_index: usize) -> Option<Located<'_>> {
|
pub fn find_node(&self, byte_index: usize, subject_type: &Rc<Type>) -> Option<Located<'_>> {
|
||||||
self.then.find_node(byte_index)
|
self.pattern
|
||||||
|
.find_node(byte_index, subject_type)
|
||||||
|
.or_else(|| self.then.find_node(byte_index))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -378,7 +378,7 @@ impl TypedExpr {
|
||||||
.or_else(|| {
|
.or_else(|| {
|
||||||
clauses
|
clauses
|
||||||
.iter()
|
.iter()
|
||||||
.find_map(|clause| clause.find_node(byte_index))
|
.find_map(|clause| clause.find_node(byte_index, &subject.tipo()))
|
||||||
})
|
})
|
||||||
.or(Some(Located::Expression(self))),
|
.or(Some(Located::Expression(self))),
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue