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
There are cases where personal comment placement style might differ from the rustfmt style, and it'd be nice to be able to choose, but I don't see an option about aligning/reindenting/moving comments around or not.
I don't know that my issues here are bugs necessarily, because I could see what rustfmt is doing being the right thing in other situations. 🤷♀
This might be a duplicate of #763 but this comment says comments are skipped by default, but that's not what I'm seeing...? Perhaps that issue means something different than I do by "formatting comments".
fn main() {
{ // I would like to talk about this scope
let x = 3; // and continue the comment here
} // and even down here
// but here is a different topic that I don't want aligned
}
rustfmt changes this into:
fn main() {
{
// I would like to talk about this scope
let x = 3; // and continue the comment here
} // and even down here
// but here is a different topic that I don't want aligned
}
Possibly related issues that might not be bugs that could instead be dealt with by turning off comment moving/formatting:
/** A status code used with all API functions. Further results
- have to be transported as out parameters. */
+have to be transported as out parameters. */
#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(PartialEq, Debug, Clone, Copy)]
pub enum APX_status {
Adorning all comments with skip attributes isn’t a workable solution.
It would be great if there was at least a way to indicate to rustfmt that it
should leave comments alone. Even better if it were possible to teach it the
commenting style of a given project.
#4108 is similar, and points out that this is inconsistent with rustfmt's apparent decision to stick to block based indentation.
This is annoying for me mostly because of the interaction with version control. For example, adding one value to an enum can cause the entire declaration to become part of a diff.
There are cases where personal comment placement style might differ from the rustfmt style, and it'd be nice to be able to choose, but I don't see an option about aligning/reindenting/moving comments around or not.
I don't know that my issues here are bugs necessarily, because I could see what rustfmt is doing being the right thing in other situations. 🤷♀
This might be a duplicate of #763 but this comment says comments are skipped by default, but that's not what I'm seeing...? Perhaps that issue means something different than I do by "formatting comments".
Examples:
rustfmt 1.4.11-nightly (2019-12-03 1838235)
rustfmt changes this into:
Possibly related issues that might not be bugs that could instead be dealt with by turning off comment moving/formatting:
The text was updated successfully, but these errors were encountered: