-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Remove all dbg
in the selected range
#12114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
can i please get some guidance on how to tackle this @lnicola? I was thinking about splitting the remove_dbg function into 2 functions like this pub(crate) fn remove_dbg(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> {
match ctx.has_empty_selection() {
true => remove_dbg_at_point(acc, ctx),
false => remove_dbg_from_range(acc, ctx),
}
}
what do you think about this approach? If it sounds reasonable, what's the best way to iterate over the nodes in an arbitrary text range with smart exclusion (i.e. people might shift select text across function or method boundaries)? if this doesn't sound as good, what would you recommend I do to tackle this? |
The closest we have to that is probably the So this part should give you some pointers on what to do here i think rust-analyzer/crates/ide-assists/src/handlers/extract_function.rs Lines 63 to 80 in 84a6fac
|
We can remove a single
dbg!(..)
by moving the cursor ondbg
, opening quick action and selecting "remove dbg". However, this is a bit troublesome when it comes to removing multipledbg
s. It would be nice if we can remove alldbg
s in the selected range.The text was updated successfully, but these errors were encountered: