fix: Fix Semantics::original_ast_node not caching the resulting file
This commit is contained in:
parent
c2eebd7a50
commit
6c379b9f4b
@ -924,7 +924,12 @@ fn original_range_opt(&self, node: &SyntaxNode) -> Option<FileRange> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 New Issue
Block a user