diff --git a/crates/rome_formatter/src/comments/builder.rs b/crates/rome_formatter/src/comments/builder.rs index 7cd95c8c0e8a..bd771df93d34 100644 --- a/crates/rome_formatter/src/comments/builder.rs +++ b/crates/rome_formatter/src/comments/builder.rs @@ -512,6 +512,7 @@ impl<'a> SourceParentheses<'a> { SourceParentheses::Empty => None, SourceParentheses::SourceMap { next, tail, .. } => { while let Some(range) = next { + #[allow(clippy::comparison-chain)] if range.transformed == offset { // A deleted range can contain multiple tokens. See if there's any `)` in the deleted // range and compute its source range. diff --git a/crates/rome_formatter/src/comments/map.rs b/crates/rome_formatter/src/comments/map.rs index 9e77b3e4a88e..90d08949bfd4 100644 --- a/crates/rome_formatter/src/comments/map.rs +++ b/crates/rome_formatter/src/comments/map.rs @@ -161,7 +161,7 @@ impl CommentsMap { #[cold] fn entry_to_out_of_order<'a>( entry: &'a mut Entry, - values: &Vec, + values: &[V], out_of_order: &mut Vec>, ) -> &'a mut OutOfOrderEntry where diff --git a/crates/rome_formatter/src/token.rs b/crates/rome_formatter/src/token.rs index 76223e484f7b..2df1d16bcd9c 100644 --- a/crates/rome_formatter/src/token.rs +++ b/crates/rome_formatter/src/token.rs @@ -488,7 +488,7 @@ where } let skipped_range = - skipped_range.unwrap_or(TextRange::empty(self.token.text_range().start())); + skipped_range.unwrap_or_else(|| TextRange::empty(self.token.text_range().start())); let verbatim = { let mut buffer = VecBuffer::new(f.state_mut()); diff --git a/crates/rome_service/src/workspace_types.rs b/crates/rome_service/src/workspace_types.rs index 5004db86e1f2..f1847392469c 100644 --- a/crates/rome_service/src/workspace_types.rs +++ b/crates/rome_service/src/workspace_types.rs @@ -65,6 +65,7 @@ fn instance_type<'a>( if let Some(description) = description { let comment = format!("/**\n\t* {} \n\t */", description); let trivia = vec![ + (TriviaPieceKind::Newline, "\n"), (TriviaPieceKind::MultiLineComment, comment.as_str()), (TriviaPieceKind::Newline, "\n"), ]; @@ -326,6 +327,7 @@ pub fn generate_type<'a>( if let Some(description) = description { let comment = format!("/**\n\t* {} \n\t */", description); let trivia = vec![ + (TriviaPieceKind::Newline, "\n"), (TriviaPieceKind::MultiLineComment, comment.as_str()), (TriviaPieceKind::Newline, "\n"), ]; diff --git a/xtask/codegen/src/generate_bindings.rs b/xtask/codegen/src/generate_bindings.rs index d3b1417ec694..1c9dcd6790d7 100644 --- a/xtask/codegen/src/generate_bindings.rs +++ b/xtask/codegen/src/generate_bindings.rs @@ -194,6 +194,7 @@ pub(crate) fn generate_workspace_bindings(mode: Mode) -> Result<()> { if let Some(description) = description { let comment = format!("/**\n\t* {} \n\t */\n", description); let trivia = vec![ + (TriviaPieceKind::Newline, "\n"), (TriviaPieceKind::MultiLineComment, comment.as_str()), (TriviaPieceKind::Newline, "\n"), ];