first impressions of RubyMine from a TextMate user

I read about RubyMine this morning on the PDXRuby dev list.  I am easily distracted by shiny objects so I downloaded the latest beta(#824) when I got to work and used it today instead of TextMate(TM).  I an currently in the middle of 2 ruby projects, one is an automated test framework and the other is a rails app that presents the results from the test framework.  I have been using TM for several years now, mostly with ruby projects and am admittedly pretty happy with it.  I'm running Mac OS X 10.5.6 on a MacBook Pro.

After installing and launching RubyMine, I walked through the prefs/settings.  Then I opened up my projects in it via the Open Directory command.

Likes:

  • the optional keyboard command set that matches TM.  This made adoption for me very easy and saved a ton of time.
  • Easy to customize the syntax colors and styles for the editor.  I was fairly quickly able to get a scheme that matches my customized TM one.
  • SVN integration is pretty nice.  I would like some keyboard shortcuts for some of the commands though.
  • The 'real-time' code error checking in the editor is nice.
  • General performance was better than I expected.  However, opening up a new project took a while to scan all the libraries.
  • In a rails controller, I liked the icons in the left margin that open up the view for that method.
  • The edited text indicator in the left margin is nice.


Don't like:

  • Can't switch between windows/frames/projects with the keybaord.  I had each project open in a different window and the only way I could switch between them (without moving them) was to right-click the RubyMine icon on the dock and select the other one from the menu.  My assumption would be that command-` (the key with the tick and tilde) would switch between windows - this is the Mac OS X standard.  Instead that key combo brings up a quck switch scheme dialog.  This is the biggest issue I have, very annoying.
  • I couldn't figure out how to get the editor to wrap lines.  I really don't line horizontal scroll bars.  I want to be able to toggle lines to wrap at the window width and/or the right margin column width.
  • Why doesn't the tab key do anything in the editor?  I keep hitting it and nothing happens.
  • syntax coloring for ruby doesn't distinguish between constants and class/module names.
  • I am really annoyed that you can place the cursor past the end of a line where ever you click.  When you click past the end of the text on a line, the cursor should 'snap' to the end of that actual content of the line (including spaces).  I keep thinking that I have a whole ton of spaces after all my lines of code.


That's what I got after one day.  I hope it's helpful.

thanks,
-Matt

14 comments
Comment actions Permalink

Matt,

Thank you for constructive feedback. It is really important and useful for us!

Can't switch between windows/frames/projects with the keybaord.  I had each project open in a different window and the only way I could switch between them (without moving them) was to right-click the RubyMine icon on the dock and select the other one from the menu.  My assumption would be that command-` (the key with the tick and tilde) would switch between windows - this is the Mac OS X standard.  Instead that key combo brings up a quck switch scheme dialog.  This is the biggest issue I have, very annoying.


You are right it is a bug. I've created and issue in bug tracking system.

  • syntax coloring for ruby doesn't distinguish between constants and class/module names.

Is it really usefull? E.g. look at valid Ruby code



class Foo
  def hello
    puts "Hello"
  end
end

OldFoo = Foo
OldFoo.new.hello





How should we highlight OldFoo here? On the one hand it is ordinary constant but on the other hand it is Class name. Grammar of Ruby language use the same notion "Constant" for ordinary constants and for constants which identify classes and modules. 

  • I am really annoyed that you can place the cursor past the end of a line where ever you click.  When you click past the end of the text on a line, the cursor should 'snap' to the end of that actual content of the line (including spaces).  I keep thinking that I have a whole ton of spaces after all my lines of code.

In fact RM doesn't create spaces when you click past the end of text. RM will insert whitespaces between end of line and cursor only if you start typing.
Also it's possible to snap cursor to the end of actual content including spaces - just enable option RM | File | Settings | Editor | "Allow placement of caret after end of line". This option is disabled by default.

  • Why doesn't the tab key do anything in the editor?  I keep hitting it and nothing happens.

It is also bug, obviously it should indent text in a line

  • I couldn't figure out how to get the editor to wrap lines.  I really don't line horizontal scroll bars.  I want to be able to toggle lines to wrap at the window width and/or the right margin column width.

It's not clear for me. You want that RM automatically wrap you code according line max width in code style settings? Should RM also reformat it? It is strange because if your resize RM window when file is under Version Controls System file will be reformatted and marked as changed. As for me I prefer to use right margin vertical line (Settings | Code Style | General | Right margin (columns)) and split code manually. I don't like to write long lines that required scrolling them horizontally.

0
Comment actions Permalink

Roman.Chernyatchik wrote:

Matt,


Thank you for constructive feedback. It is really important and useful for us!

Good to hear.  Thanks for the detailed reply.  You've got a nice tool here.

Can't switch between windows/frames/projects with the keybaord.  I had each project open in a different window and the only way I could switch between them (without moving them) was to right-click the RubyMine icon on the dock and select the other one from the menu.  My assumption would be that command-` (the key with the tick and tilde) would switch between windows - this is the Mac OS X standard.  Instead that key combo brings up a quck switch scheme dialog.  This is the biggest issue I have, very annoying.


You are right it is a bug. I've created and issue in bug tracking system.

  • syntax coloring for ruby doesn't distinguish between constants and class/module names.

Is it really usefull? E.g. look at valid Ruby code


class Foo
  def hello
    puts "Hello"
  end
end


OldFoo = Foo
OldFoo.new.hello





How should we highlight OldFoo here? On the one hand it is ordinary constant but on the other hand it is Class name. Grammar of Ruby language use the same notion "Constant" for ordinary constants and for constants which identify classes and modules.

That sounds reasonable.  I can live with it the way it is.

  • I am really annoyed that you can place the cursor past the end of a line where ever you click.  When you click past the end of the text on a line, the cursor should 'snap' to the end of that actual content of the line (including spaces).  I keep thinking that I have a whole ton of spaces after all my lines of code.

In fact RM doesn't create spaces when you click past the end of text. RM will insert whitespaces between end of line and cursor only if you start typing.
Also it's possible to snap cursor to the end of actual content including spaces - just enable option RM | File | Settings | Editor | "Allow placement of caret after end of line". This option is disabled by default.

Thanks, that's the option I was looking for.

  • Why doesn't the tab key do anything in the editor?  I keep hitting it and nothing happens.

It is also bug, obviously it should indent text in a line

  • I couldn't figure out how to get the editor to wrap lines.  I really don't line horizontal scroll bars.  I want to be able to toggle lines to wrap at the window width and/or the right margin column width.

It's not clear for me. You want that RM automatically wrap you code according line max width in code style settings? Should RM also reformat it? It is strange because if your resize RM window when file is under Version Controls System file will be reformatted and marked as changed. As for me I prefer to use right margin vertical line (Settings | Code Style | General | Right margin (columns)) and split code manually. I don't like to write long lines that required scrolling them horizontally.

What I'd like, is to have an option for the editor to visually wrap lines that would extend beyond the visible editing area.  Not to actually insert linefeeds or anything, just allow me to see the wole line of code wrapped across 2+ lines when the window is too narrow.  I generally keep my code manually wrapped, but I often need to look at other code that is not as tidy.

thanks again,
-Matt

0
Comment actions Permalink

Hello Roman,

Let me break in here and express a simple format wish: Could you add a option to indent the when clauses in a case statement?  Your editor doesn't recognize a case statement as a syntactic scope, analogous to an if.  It's non-foldable, too.

I realize this is not the standard formatting in the pickaxe, but there are folks out here who prefer the indentation (i.e. MacRubyists Laurent Sansonetti and Rich Killmer, and more humbly, me.)

Just a thought.

Bob Schaaf

0
Comment actions Permalink

Robert,

Could you add a option to indent the when clauses in a case statement?  Your editor doesn't recognize a case statement as a syntactic scope, analogous to an if. 

I've created issue for this - http://www.jetbrains.net/jira/browse/RUBY-3677. Feel free to vote, track status and comment it. I suppose such option will not be included in RubyMine 1.0 release

It's non-foldable, too.

Folding for case..end statement will be available in next EAP =) Is folding for when clauses inside case statement also desirable?

0
Comment actions Permalink

Roman,

Thanks for the quick response.

Since case statements usually don't have much code per condition (at least mine) but rather dispatch elsewhere, I don't see much value in also folding the whens, which would only clutter the fold markers in the margin.

Here's the desired formatting, code thanks to L. Sansonetti:


  def tableView_objectValueForTableColumn_row(aTableView, theColumn, rowIndex)
    case theColumn.identifier.to_s
      when 'page'
        @searchResults[rowIndex].pages.objectAtIndex(0).label
      when 'section'
        item = @pdfView.document.outlineItemForSelection(@searchResults[rowIndex])
        item ? item.label : nil
    end
  end


Thanks again,

Bob Schaaf





0
Comment actions Permalink

Hello guys,

Here's the desired formatting, code thanks to L. Sansonetti:


  def tableView_objectValueForTableColumn_row(aTableView, theColumn, rowIndex)
    case theColumn.identifier.to_s
      when 'page'
        @searchResults[rowIndex].pages.objectAtIndex(0).label
      when 'section'
        item = @pdfView.document.outlineItemForSelection(@searchResults[rowIndex])
        item ? item.label : nil
    end

  end

We can add formatting option to indent when cases within case statement, but we haven't done this at the very begging because we wanted to have all the statements like case, if, unless, begin-end statements to look the same.
For example we have following style for if statement:

if some_cond

     do_something

elsif other_cond

     do_something_else

else

     do_nothing

end

You can see that RM preserved the same alignment for if, elsif, else and end keywords. We have the same idea about case statement. Is current formatting model for other statements suitable for you?

Looking forward to hearing from you,
Oleg

0
Comment actions Permalink

Hello Roman,

Since the parser doesn't care one bit, this seems like counting angels on the head of a pin.

That said, I have always preferred a formatting convention such that when you have any keyword balanced by an end, all that comes between should be indented, to make the scope visually clear.  The if...else/elsif...end construct is a special case, in that every else or elsif balances the initial if, and so  I agree with your formatting in this case.

I can't think of anything other than the case statement that I would allow for.  And it sure is nice to have the reformatting.

Thanks again for your attention,

Bob Schaaf

0
Comment actions Permalink

Hello guys,

We've fixed RubyMine formatter to indent when statements inside case statements. Fixed version will be available soon.

Wbr,
Oleg

0
Comment actions Permalink

Thanks Oleg,

You guys are da bomb!

Onward to learning the product.

Bob Schaaf

0
Comment actions Permalink

Oleg,

I just downloaded 1.0.  The formatting is all I could ask for!

Thanks again,

Bob Schaaf

0
Comment actions Permalink

HazMatt wrote:
What I'd like, is to have an option for the editor to visually wrap lines that would extend beyond the visible editing area.  Not to actually insert linefeeds or anything, just allow me to see the wole line of code wrapped across 2+ lines when the window is too narrow.  I generally keep my code manually wrapped, but I often need to look at other code that is not as tidy.


I think this is absolutely essential.  In TextMate it's called 'Soft Wrap'.   Please can you consider adding it Roman?

Another request I would like to make is the ability to insert ERB tags (e.g. <% %> or <%= %>) as easily as in TextMate (Ctrl + Shift + >).  Perhaps this is already possible?

0
Comment actions Permalink

Another request I would like to make is the ability to insert ERB tags (e.g. <% %> or <%= %>) as easily as in TextMate (Ctrl + Shift + >).  Perhaps this is already possible?

This works in RubyMine(shortcut is described in key map reference RM | Help | Default Keymap Reference): Meta+Shift + .

I think this is absolutely essential.  In TextMate it's called 'Soft Wrap'.   Please can you consider adding it Roman?

I've filled feature request. If it gather enough votes we will consider such feature (see http://www.jetbrains.net/jira/browse/IDEABKL-1132)

0
Comment actions Permalink

Hi

I registered just to add my voice to the "please add Soft Wrap feature" request.
This feature is absolutely essential. Code like free-hand SQL queries via find_by_sql are often much wider than width of the window I usually work in.
Please, add the feature - this is the biggest problem I have with RM right now..

Thanks
Mikhail.

0
Comment actions Permalink

Develop with pleasure

0

Please sign in to leave a comment.