I think it depends on how the recovery path is made.
During the lexical scanning stage you can persist the token's source code sites, and later reuse them to indicate syntax or similar errors.
For example, in Rust when you parse the syntax from the TokenStream of a procedural macro input, you can bind custom errors to any spans of input tokens, and it works just fine.