]> git.lizzy.rs Git - rust.git/commit
Merge #989
authorbors[bot] <bors[bot]@users.noreply.github.com>
Mon, 18 Mar 2019 08:24:18 +0000 (08:24 +0000)
committerbors[bot] <bors[bot]@users.noreply.github.com>
Mon, 18 Mar 2019 08:24:18 +0000 (08:24 +0000)
commit7c117567ab55046a9303fc7a6676a50008ad4f33
tree5f00d197d1dc9f8ab108afb394cedf227d892288
parent4c1ea0b628f949612b48dd3b65c7d8bb2255f572
parentca262fbab80dd74fd585544b9e6ce99e394dc573
Merge #989

989: Implement naive version of fill_struct_fields assist r=matklad a=yanchith

Fixes #964

This implements the `fill_struct_fields` assist. Currently only works for named struct fields, but not for tuple structs, because we seem to be missing a `TupleStructLit` (akin to `StructLit`, but for tuple structs). I am happy to implement `TupleStructLit` parsing given some guidance (provided it's really missing) and make the assist work for tuple structs as well. Could do so either in this PR, or another one ðŸ™‚

Sorry if I missed something important, this is my first PR for Rust Analyzer.

Btw is there any way to run the assists in emacs?

UPDATE: I just realized that parsing `TupleStructLit` would be quite difficult as it it really similar, if not identical to a function call...

Co-authored-by: yanchith <yanchi.toth@gmail.com>
crates/ra_assists/src/lib.rs