fix: Fix Semantics::original_ast_node not caching the resulting file

This commit is contained in:
Lukas Wirth 2022-07-27 12:45:29 +02:00
parent c2eebd7a50
commit 6c379b9f4b

View File

@ -924,7 +924,12 @@ fn original_range_opt(&self, node: &SyntaxNode) -> Option<FileRange> {
}
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 {