rustfix icon indicating copy to clipboard operation
rustfix copied to clipboard

Original text missing leading character in Suggestion

Open jsgf opened this issue 4 years ago • 3 comments

The suggestion original line snippets are missing the first character on multiline fixes.

For example, a clippy warning about a redundant return at https://github.com/facebookexperimental/eden/blob/139717db04a9a28fca7f3d81553275198bbbb8a1/eden/mononoke/sshrelay/src/lib.rs#L165 shows a fix with the original text:

return Err(io::Error::new(\n                       io::ErrorKind::InvalidInput,\n                       \"bad ssh stream\",\n                   ))

but the leading space on the lines after the first is one less than the actual indent in the file.

Detailed repro: https://gist.github.com/jsgf/5760b514af320de4c06db0ca1e43a1d4

jsgf avatar Apr 24 '20 23:04 jsgf

Ping?

jsgf avatar Jun 11 '20 19:06 jsgf

This is a valid bug, but I'm not sure if folks are actively hacking on rustfix right now. PRs to fix this will be accepted.

Manishearth avatar Jun 12 '20 00:06 Manishearth

OK. I'll dig into it when I get a chance.

jsgf avatar Jun 12 '20 07:06 jsgf