You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let pre_comment_snippet = trim_tries(context.snippet(pre_comment_span));
rustfmt intentionally trims the try operator and then removes the resulting blank line (the try operator is checked elsewhere and reattached later). However, it appears that it mistakenly removes the blank line even when there isn’t a try operator. —just my guess, though.
Using vscode I comment out the following to test something quickly, and save
Rustfmt produces the following output
I finish testing.
The commented code is still highlighted and I need to Ctrl-Z 2 times and save again to get my original, clear, code.
I would expect 2+(incl.) newlines to get reduced to 1, but single ones should be kept.
Commented section does not necessarily need to be code.
$rustfmt --version rustfmt 1.7.1-stable (f6e511e 2024-10-15)
The text was updated successfully, but these errors were encountered: