Skip to content

Conversation

@geoffreycopin
Copy link
Contributor

@geoffreycopin geoffreycopin commented Apr 9, 2020

This PR implements the "Reorder record fields" assist as discussed in issue #3821 .

Adding a RecordFieldPat variant to the Pat enum seemed like the easiest way to handle the RecordPat children as a single sequence of elements, maybe there is a better way ?

}

fn struct_definition(path: &ast::Path, sema: &Semantics<RootDatabase>) -> Option<Struct> {
match sema.resolve_path(path) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should use variant_resolutions and not just resolve_paths, but it's not clear how to best expose this API for an IDE, so I guess this is ok as an initial impl

@matklad
Copy link
Contributor

matklad commented Apr 11, 2020

bors try

(looks like CI is failing?)

bors bot added a commit that referenced this pull request Apr 11, 2020
@bors
Copy link
Contributor

bors bot commented Apr 11, 2020

try

Build failed

@matklad
Copy link
Contributor

matklad commented Apr 11, 2020

bors r+

@geoffreycopin
Copy link
Contributor Author

Indeed, I had not generated the documentation after adding the doc comment.

@bors
Copy link
Contributor

bors bot commented Apr 11, 2020

@bors bors bot merged commit fd06fe7 into rust-lang:master Apr 11, 2020
@eminence eminence mentioned this pull request Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants