rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

'Convert to manual ...' code action doesn't send the missing members code when snippetTextEdits are disabled

Open simrat39 opened this issue 4 years ago • 1 comments

Pretty much the title.

Without snippet text edits enabled:

image

With:

image

References: https://github.com/simrat39/rust-tools.nvim/issues/53 https://github.com/simrat39/rust-tools.nvim/issues/60

simrat39 avatar Sep 07 '21 01:09 simrat39

On the match arm that handles when snippetTextEdits is unavailable, it ignores whether impl_def_with_items is Some, which is important since impl_def_with_items contains the impl with the correct missing members. https://github.com/rust-lang/rust-analyzer/blob/ea7fdada6a0940b239ddbde2048a4d7dac1efe1e/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs#L147-L155

The other match arms correctly deal with impl_def_with_items but only differ in that they add snippets. Ideally this match arm should be removed and the snippet capability handling moved inside of the other two match arms.

DropDemBits avatar Jul 01 '24 03:07 DropDemBits

I am ok to take the issue.

Samarth1696 avatar Jul 21 '24 19:07 Samarth1696