1

I'm working on some procedural macros in Rust and I use vim-lsp to help me write Rust. I find it very helpful when the compiler error suggests a change to fix an error and I can use a quick action to apply the fix.

In my proc macros, I use syn::Error to provide spanned compiler errors for users of my macros. Is there any way for me to encode quick fixes into my compiler errors?

EtTuBrute
  • 502
  • 5
  • 16
  • You probably would need to write an extension to `cargo check` or clippy. – Peter Hall Jun 26 '21 at 23:05
  • 2
    Adding diagnostic detail to proc macro errors is [currently](https://github.com/rust-lang/rust/issues/54140) an unstable feature, and even that feature as presently implemented does not support emitting code suggestions (although there's certainly demand for that, and it may get added later). So, short answer is "no, not yet". – eggyal Jun 27 '21 at 09:31

0 Answers0