Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/lib.rs')
| -rw-r--r-- | crates/hir-def/src/lib.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/hir-def/src/lib.rs b/crates/hir-def/src/lib.rs index de3ab57a12..d63f2268aa 100644 --- a/crates/hir-def/src/lib.rs +++ b/crates/hir-def/src/lib.rs @@ -1341,8 +1341,11 @@ impl AsMacroCall for InFile<&ast::MacroCall> { let expands_to = hir_expand::ExpandTo::from_call_site(self.value); let ast_id = AstId::new(self.file_id, db.ast_id_map(self.file_id).ast_id(self.value)); let span_map = db.span_map(self.file_id); - let path = - self.value.path().and_then(|path| path::ModPath::from_src(db, path, span_map.as_ref())); + let path = self.value.path().and_then(|path| { + path::ModPath::from_src(db, path, &mut |range| { + span_map.as_ref().span_for_range(range).ctx + }) + }); let Some(path) = path else { return Ok(ExpandResult::only_err(ExpandError::other("malformed macro invocation"))); |