internal: log original syntax on panic
This commit is contained in:
parent
6f8e75a559
commit
4d541f7cf3
@ -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) {
|
match self.map.raw_entry().from_hash(hash, |&idx| self.arena[idx] == ptr) {
|
||||||
Some((&idx, &())) => ErasedFileAstId(idx.into_raw().into_u32()),
|
Some((&idx, &())) => ErasedFileAstId(idx.into_raw().into_u32()),
|
||||||
None => panic!(
|
None => panic!(
|
||||||
"Can't find {:?} in AstIdMap:\n{:?}",
|
"Can't find {:?} in AstIdMap:\n{:?}\n source text: {}",
|
||||||
item,
|
item,
|
||||||
self.arena.iter().map(|(_id, i)| i).collect::<Vec<_>>(),
|
self.arena.iter().map(|(_id, i)| i).collect::<Vec<_>>(),
|
||||||
|
item
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user