This Question is Possibly Answered

1 "correct" answer available (4 pts) 1 "helpful" answer available (2 pts)
3 Replies Last post: Feb 9, 2010 6:23 PM by Roman.Chernyatchik  
Tarmo Lehtpuu Newbie 2 posts since
Jan 29, 2010
Currently Being Moderated

Jan 29, 2010 2:14 PM

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?

Oleg Shpynov JetBrains 1,172 posts since
Nov 6, 2007
Currently Being Moderated
Jan 29, 2010 2:25 PM in response to: Tarmo Lehtpuu
Re: Autoformatting and whitespace

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

Roman.Chernyatchik  JetBrains 1,449 posts since
Sep 18, 2007
Currently Being Moderated
Feb 9, 2010 6:23 PM in response to: Tarmo Lehtpuu
Re: Autoformatting and whitespace

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

More Like This

  • Retrieving data ...