Configure indent for 'pipes' in Rubymine

Answered

Currently Rubymine formats:

 

[]
.select { |x| x }
.reject { |x| x.nil? }
.each do |x|
puts "x is #{x}"
end

 

 

as:

 

[]
.select { |x| x }
.reject { |x| x.nil? }
.each do |x|
puts "x is #{x}"
end

 

 

I want the block passed to each to be formatted relative to the each method. How can I achieve this in Rubymine?

3 comments
Comment actions Permalink

Hello,

it appears to be a known problem, please take a look:

https://youtrack.jetbrains.com/issue/RUBY-20225

0
Comment actions Permalink

Hi Olga,

 

Thanks for replying. The issue you mention is pretty old already, 2 years. Is there any chance this will be resolved? If not, is there a way to hook into the formatter and configure this myself?

0
Comment actions Permalink

I've updated the affected versions section. Unfortunately there's no way to hook it somehow but still you can leave a comment there and add your vote so that we understand how many people face this problem.

0

Please sign in to leave a comment.