internal: log original syntax on panic

This commit is contained in:
David Barsky 2024-10-23 12:44:57 -07:00
parent 6f8e75a559
commit 4d541f7cf3

View File

@ -224,9 +224,10 @@ fn erased_ast_id(&self, item: &SyntaxNode) -> ErasedFileAstId {
match self.map.raw_entry().from_hash(hash, |&idx| self.arena[idx] == ptr) {
Some((&idx, &())) => ErasedFileAstId(idx.into_raw().into_u32()),
None => panic!(
"Can't find {:?} in AstIdMap:\n{:?}",
"Can't find {:?} in AstIdMap:\n{:?}\n source text: {}",
item,
self.arena.iter().map(|(_id, i)| i).collect::<Vec<_>>(),
item
),
}
}