Skip to content

Commit

Permalink
Fix end defs comments
Browse files Browse the repository at this point in the history
Fixes #295
  • Loading branch information
fables-tales committed May 31, 2021
1 parent 3cd7b85 commit f26e3b5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions fixtures/small/defs_end_comment_actual.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class A
def self.m
operation_name
# @@formatted_op_names.compute_if_absent(operation_name) do
# operation_name.to_s.split('_').collect(&:capitalize).join
# end
end
end
8 changes: 8 additions & 0 deletions fixtures/small/defs_end_comment_expected.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class A
def self.m
operation_name
# @@formatted_op_names.compute_if_absent(operation_name) do
# operation_name.to_s.split('_').collect(&:capitalize).join
# end
end
end
2 changes: 1 addition & 1 deletion librubyfmt/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,7 @@ pub fn format_defs(ps: &mut dyn ConcreteParserState, defs: Defs) {
}),
);

ps.wind_line_forward();
ps.wind_dumping_comments();
ps.emit_end();

if ps.at_start_of_line() {
Expand Down

0 comments on commit f26e3b5

Please sign in to comment.