Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Jan 31, 2022
1 parent 9f51206 commit 6e970ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion crates/rome_formatter/src/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,13 @@ impl Formatter {
Ok(result.into_iter())
}

/// It formats a list of nodes that are not separated.
/// It formats a list of nodes that are not separated. It's a ad-hoc function to
/// format lists that implement [rslint_parser::AstNodeList].
///
/// The elements of the list are joined together using [join_elements_hard_line], which will
/// end up separated by hard lines or empty lines.
///
/// If the formatter fails to format an element, said element gets printed verbatim.
pub fn format_list<List, Node: Clone + AstNode + ToFormatElement>(
&self,
list: List,
Expand Down
3 changes: 2 additions & 1 deletion crates/rome_formatter/src/ts/root/module.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use crate::ts::directives::format_directives_list;
use crate::ts::root::format_interpreter;
use crate::{
format_elements, hard_line_break, FormatElement, FormatResult, Formatter, ToFormatElement,
format_elements, hard_line_break, join_elements_hard_line, FormatElement, FormatResult,
Formatter, ToFormatElement,
};
use rslint_parser::ast::JsModule;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/rome_formatter/tests/spec_test.rs
assertion_line: 43
assertion_line: 57
expression: newlines.js

---
Expand Down

0 comments on commit 6e970ae

Please sign in to comment.