Draft inlay hint part hover detection

This commit is contained in:
Kirill Bulatov 2023-08-16 14:21:26 +03:00
parent bc7e9088fe
commit d34491e822
3 changed files with 125 additions and 27 deletions

View file

@ -386,6 +386,17 @@ impl InlayHintCache {
self.hints.clear();
}
pub fn hint_by_id(&self, excerpt_id: ExcerptId, hint_id: InlayId) -> Option<InlayHint> {
self.hints
.get(&excerpt_id)?
.read()
.hints
.iter()
.find(|&(id, _)| id == &hint_id)
.map(|(_, hint)| hint)
.cloned()
}
pub fn hints(&self) -> Vec<InlayHint> {
let mut hints = Vec::new();
for excerpt_hints in self.hints.values() {