rust-lang / rust-lang/rust-analyzer
proc macro crate delayed diagnostic with check workspace = false
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
rust-analyzer version: rust-analyzer 0.3.3041-standalone
rustc version: rustc 1.98.1 (48a229cea 2026-09-01)
editor or extension: neovim, rustaceanvim
relevant settings:
['rust-analyzer'] = {
check = {
workspace = false,
command = "clippy"
},
},
repository link (if public, optional): N/A
code snippet to reproduce:
- proc macro crate
check.workspace = false
It's a sizeable derive macro. I make a change, say replace todo!() -> tod!() and save the file. In theory it should update the errors immediately, but to actually see the new error I need to save it the second time.
I don't think contents of the macro itself matter, more about the size. Somewhat works with this:
#![allow(dead_code)]
//! doc
use proc_macro::TokenStream;
#[proc_macro_derive(Thing)]
pub fn thing(_input: TokenStream) -> TokenStream {
"let _ = 42;".parse().unwrap()
}
fn dead0() {}
struct S0;
fn dead1() {}
struct S1;
// 30 of each. Maybe more better?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in a sizeable Rust proc-macro workspace using rust-analyzer with check.workspace = false and check.command = "clippy". Compare diagnostics after the first and second save, then trace proc-macro checking and diagnostic update scheduling. Done means replacing or introducing an error in the macro updates diagnostics after one save.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100