-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
A-idegeneral IDE featuresgeneral IDE featuresC-featureCategory: feature requestCategory: feature request
Description
consider the following code used w/ the serde library:
use serde::Deserialize;
#[derive(Deserialize)]
struct Foo {
#[serde(default)]
// ^^^^^ unresolvedReference
bar: u64,
}
We should be able to figure out if this is a valid attribute or not, by looking at the things the structs derive from and looking at the attributes for each proc macro to compute a list of identifiers that are valid within this context:
// in serde_derive/src/lib.rs
#[proc_macro_derive(Deserialize, attributes(serde))]
// ^^^^^ we should find these.
pub fn derive_deserialize(input: TokenStream) -> TokenStream {
let mut input = parse_macro_input!(input as DeriveInput);
de::expand_derive_deserialize(&mut input)
.unwrap_or_else(to_compile_errors)
.into()
}
Bonus points would be to have a hover implementation that shows which proc macro's are consuming this attribute as well!
rust-analyzer version: 6434ada 2021-12-05 dev
rustc-version: 1.57.0
Metadata
Metadata
Assignees
Labels
A-idegeneral IDE featuresgeneral IDE featuresC-featureCategory: feature requestCategory: feature request