zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.45k stars 3.12k forks source link

Rust - Add missing fields for struct initialization #21010

Closed Leikoe closed 13 hours ago

Leikoe commented 13 hours ago

Check for existing issues

Describe the feature

In rust rover, when writing the struct initialization syntax (in rust), the ide has an "Add missing fields" prompt which can, when clicked, add all the missing fields and their respective type's default value.

image

Environment

Zed: v0.162.3 (Zed) OS: macOS 15.1.0 Memory: 16 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help present your vision of the feature

No response

Leikoe commented 13 hours ago

I'm guessing it has to do with this https://rust-analyzer.github.io/manual.html#missing-fields

osiewicz commented 13 hours ago

There's already a code action to fill missing struct fields + the diagnostics: image

Leikoe commented 13 hours ago

There's already a code action to fill missing struct fields + the diagnostics: image

Thank you so much, I've searched for this for the longest time. Sorry to have wasted your time : (

osiewicz commented 13 hours ago

No worries! I hope you're having blast using Zed :)

Leikoe commented 12 hours ago

No worries! I hope you're having blast using Zed :)

Thank you so much, I AM ! 😁