mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-06 10:18:53 +00:00
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:
commit
8e4d9b84fe
1 changed files with 6 additions and 1 deletions
|
@ -924,7 +924,12 @@ impl<'db> SemanticsImpl<'db> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn original_ast_node<N: AstNode>(&self, node: N) -> Option<N> {
|
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 {
|
fn diagnostics_display_range(&self, src: InFile<SyntaxNodePtr>) -> FileRange {
|
||||||
|
|
Loading…
Reference in a new issue