fix: Fix completions panicking with certain macro setups

This commit is contained in:
Lukas Wirth 2024-02-27 09:35:57 +01:00
parent 5fead606bc
commit cc7fe32ba3
6 changed files with 19 additions and 6 deletions

View file

@ -969,8 +969,10 @@ impl<'db> SemanticsImpl<'db> {
match value.parent() {
Some(parent) => Some(InFile::new(file_id, parent)),
None => {
self.cache(value.clone(), file_id);
Some(file_id.macro_file()?.call_node(db))
let call_node = file_id.macro_file()?.call_node(db);
// cache the node
self.parse_or_expand(call_node.file_id);
Some(call_node)
}
}
})