Auto merge of #12886 - Veykril:sema-cache, r=Veykril

fix: Fix Semantics::original_ast_node not caching the resulting file
This commit is contained in:
bors 2022-07-27 10:46:20 +00:00
commit 8e4d9b84fe

View file

@ -924,7 +924,12 @@ impl<'db> SemanticsImpl<'db> {
}
fn original_ast_node<N: AstNode>(&self, node: N) -> Option<N> {
self.wrap_node_infile(node).original_ast_node(self.db.upcast()).map(|it| it.value)
self.wrap_node_infile(node).original_ast_node(self.db.upcast()).map(
|InFile { file_id, value }| {
self.cache(find_root(value.syntax()), file_id);
value
},
)
}
fn diagnostics_display_range(&self, src: InFile<SyntaxNodePtr>) -> FileRange {