mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
fix: Fix nested macro diagnostics pointing at macro expansion files
This commit is contained in:
parent
52bc15fc1f
commit
dc8254c6ab
4 changed files with 25 additions and 19 deletions
|
@ -9,10 +9,7 @@ pub(crate) fn unresolved_macro_call(
|
|||
d: &hir::UnresolvedMacroCall,
|
||||
) -> Diagnostic {
|
||||
// Use more accurate position if available.
|
||||
let display_range = d
|
||||
.precise_location
|
||||
.unwrap_or_else(|| ctx.sema.diagnostics_display_range(d.macro_call.clone()).range);
|
||||
|
||||
let display_range = ctx.resolve_precise_location(&d.macro_call, d.precise_location);
|
||||
let bang = if d.is_bang { "!" } else { "" };
|
||||
Diagnostic::new(
|
||||
"unresolved-macro-call",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue