-1

everyone.

Wanted to know, is it possible to edit, how RubyMine reformats code, so that code like this:

some_object = {
      :long_named_item => 'value',
      :short_item => 'value'
    }

user = User.create!({
                     :nickname => 'value',
                     :age => 18
                    })

gets reformated like this:

some_object = {
      :long_named_item => 'value',
      :short_item      => 'value'
    }

    user = User.create!({
                          :nickname => 'value',
                          :age      => 18
                        })

or, even with js:

var some_variable = {
    'long_named_item': 'value',
    'short_item': 'value'
}

to:

var some_variable = {
    'long_named_item': 'value',
    'short_item':      'value'
}

Notice the spacing between hash item name and value

My friend said, that SublimeText does this with python code, so wanted to know, is this possible in RubyMine.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
ExClouds
  • 527
  • 1
  • 7
  • 13
  • 1
    `Settings (Preferences on Mac) | Code Style | YOUR_LANGUAGE` -- check formatting options there. For your **specific JavaScript example**: yes, such alignment is possible. – LazyOne Nov 13 '14 at 12:01

1 Answers1

0

After looking at formatting options in RubyMine, i found exactly, what i wanted.. For Javascript, the value i had to chose for "Align object properties" was "on value" And for Ruby i had to tick option "Align right parts of assigments or hashes"

Both were under:

Settings (Preferences on Mac) | Code Style | YOUR_LANGUAGE | Other

Thanks to LazyOne

ExClouds
  • 527
  • 1
  • 7
  • 13