Autoformatting and whitespace

What is going on with autoformat eating whitespace more greedily with each release?

The ideal way for me would be like this (Rubymine < 2.0)

create_table :test do |t|
     t.integer       :foo,    :null => false   
     t.datetime    :bar,    :null => false  
     t.string         :baz,   :null => false,   :limit => 32      
end



Then in 2.0 or 2.0.1 suddenly this happened:

create_table :test do |t|
     t.integer :foo,        :null => false   
     t.datetime :bar,     :null => false  
     t.string :baz,         :null => false,   :limit => 32      
end



And now in 2.0.2 autoformat collapses all white space:

create_table :test do |t|

     t.integer :foo, :null => false   
     t.datetime :bar, :null => false  
     t.string :baz, :null => false, :limit => 32      
end




I like most of my Ruby code formatted with whitespac so it neatly aligns into columns and I also like autoformat, but it's pretty impossible to use after 2.0.2. Can't find any options either how to make autoformat eat a little less whitespace in the middle of the lines
Does anyone know of any option to configure it or would it possible to add one?
3 comments
Comment actions Permalink

Hello Tarmo,

It seems like it's a RubyMine bug, I've created an issue: http://youtrack.jetbrains.net/issue/RUBY-5715
Feel free to vote, comment and track progress of it.

Regards,
Oleg

0
Comment actions Permalink

Thanks Oleg, hope it will get fixed for next release

0
Comment actions Permalink

And now in 2.0.2 autoformat collapses all white space:

Hmmm, latest published RubyMine version is 2.0.1

In my case RM just remove useless whitespace before ":foo", and ":null"
E.g.

1.

  create_table :test do |t|     t.integer   :foo,       :null => false     t.datetime  :bar, :null => false     t.string    :baz,   :null => false, :limit => 32   end



will be converted to

create_table :test do |t|     t.integer   :foo, :null => false     t.datetime  :bar, :null => false     t.string    :baz, :null => false, :limit => 32   end



2.

  create_table :test do |t|     t.integer :foo,       :null => false     t.datetime  :bar, :null => false     t.string     :baz,   :null => false, :limit => 32   end

to

  create_table :test do |t|     t.integer :foo, :null => false     t.datetime  :bar, :null => false     t.string     :baz, :null => false, :limit => 32   end

0

Please sign in to leave a comment.