Skip to content

Commit 256602e

Browse files
authored
[prism] Don't emit soft tokens in next arguments (#750)
1 parent bd842ff commit 256602e

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
items.map do |config|
2+
next config if config.is_a?(UrlConfig)
3+
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
items.map do |config|
2+
next config if config.is_a?(UrlConfig)
3+
end

librubyfmt/src/format_prism.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4295,7 +4295,14 @@ fn format_next_node<'src>(ps: &mut ParserState<'src>, next_node: prism::NextNode
42954295
if let Some(arguments_node) = next_node.arguments() {
42964296
ps.with_start_of_line(false, |ps| {
42974297
ps.emit_space();
4298-
format_arguments_node(ps, arguments_node);
4298+
ps.with_start_of_line(false, |ps| {
4299+
format_list_like_thing(
4300+
ps,
4301+
arguments_node.arguments(),
4302+
arguments_node.location().end_offset(),
4303+
true,
4304+
);
4305+
});
42994306
});
43004307
}
43014308
}

0 commit comments

Comments
 (0)