Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Derive trait recursively #12330

Open
Cldfire opened this issue May 20, 2022 · 0 comments · May be fixed by #18118
Open

[Feature Request] Derive trait recursively #12330

Cldfire opened this issue May 20, 2022 · 0 comments · May be fixed by #18118
Labels
A-assists A-diagnostics diagnostics / error reporting A-ty type system / type inference / traits / method resolution C-feature Category: feature request

Comments

@Cldfire
Copy link

Cldfire commented May 20, 2022

Imagine you're in the following situation:

  • You need serde::Serialize implemented for a struct that doesn't already have it
  • This struct contains a lot of fields with lots of types from other crates in the workspace that also don't have serde::Serialize derived yet

You now have to spend minutes of your time clicking through to all of the different types and adding #[derive(Serialize)] to them (plus relevant imports).

What if Rust Analyzer could do this for us? There could be an assist on #[derive(Serialize)] for the top-level type that said "Derive recursively for all children" and went through and automatically did all of this work.

@flodiebold flodiebold added A-diagnostics diagnostics / error reporting A-ty type system / type inference / traits / method resolution A-assists C-feature Category: feature request labels May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-assists A-diagnostics diagnostics / error reporting A-ty type system / type inference / traits / method resolution C-feature Category: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants