Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Handle empty and single element Arrays
  • Loading branch information
DRBragg committed Apr 22, 2022
commit a12a74a9020117048e3336320b2afeea404d727f
6 changes: 5 additions & 1 deletion lib/syntax_tree/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2076,7 +2076,11 @@ def format(q)
end
elsif part.is_a?(ArrayLiteral)
q.text(" ")
q.format(part.contents)
if part.contents && part.contents.parts.length > 1
q.format(part.contents)
else
q.format(arguments)
end
else
format_arguments(q, "(", ")")
end
Expand Down