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
E.g. I often have the following situation when I want to comment out a method:
Before:
Since Sublime Text removes all trailing whitespace, I place the cursor in the empty line before the function, hold Shift, place the cursor in the empty line after the function, so that my text selection includes the whole method, then I do Ctrl+Shift+/ to toggle-multi-line comment the text selection, which results in this:
Then I do Ctrl+S to save the file and invoke RustFmt, which results in this:
It indented my outcommented method so that it's not aligned with my non-outcommented methods anymore.
Please don't do this. It'd be ok to just indent the lines containing only /* and */ but not the comment's body. But I'd prefer if it didn't indent these at all!
Can you show some cases where you think rustfmt should indent multi-line comments' bodies?
Then we could distinguish when it should and should not indent. I think at least when the comment starts and ends at zero indentation (column 0) it should leave it as it is.
E.g. cases like this would still be indented:
fnfoo(&self){}/* doesn't end at column 0 */fnbar(&self){}
I'm using rustfmt 1.4.8-nightly (afb1ee1c 2019-09-08).
The text was updated successfully, but these errors were encountered:
E.g. I often have the following situation when I want to comment out a method:
Before:
Since Sublime Text removes all trailing whitespace, I place the cursor in the empty line before the function, hold Shift, place the cursor in the empty line after the function, so that my text selection includes the whole method, then I do
Ctrl+Shift+/
to toggle-multi-line comment the text selection, which results in this:Then I do
Ctrl+S
to save the file and invoke RustFmt, which results in this:It indented my outcommented method so that it's not aligned with my non-outcommented methods anymore.
Please don't do this. It'd be ok to just indent the lines containing only
/*
and*/
but not the comment's body. But I'd prefer if it didn't indent these at all!Can you show some cases where you think rustfmt should indent multi-line comments' bodies?
Then we could distinguish when it should and should not indent. I think at least when the comment starts and ends at zero indentation (column 0) it should leave it as it is.
E.g. cases like this would still be indented:
I'm using
rustfmt 1.4.8-nightly (afb1ee1c 2019-09-08)
.The text was updated successfully, but these errors were encountered: