]> git.lizzy.rs Git - rust.git/commit
Add new assist to remove dbg!() calls
authorVille Penttinen <villem.penttinen@gmail.com>
Thu, 7 Feb 2019 18:00:58 +0000 (20:00 +0200)
committerVille Penttinen <villem.penttinen@gmail.com>
Thu, 7 Feb 2019 18:34:33 +0000 (20:34 +0200)
commit6cbf83c9462b993f2fa5b3c4334dd469c182c8af
treeac6bc4ebc0638cbf1b8aa44fddd3bbfd64a75eeb
parentd0fd05142f45fb69a9dc64bfd55d2453b1927b9c
Add new assist to remove dbg!() calls

This fixes #758.

Currently we try to maintain the cursor position relative to the statement under
cursor, if the cursor is inside the dbg! macro call.

Meaning:

let foo = dbg!(some.complex<|>().expression());

Should turn into:

let foo = some.complex<|>().expression();

With the cursor staying in place.
crates/ra_assists/src/lib.rs
crates/ra_assists/src/remove_dbg.rs [new file with mode: 0644]