RubyMine wishlist

A lot of nice work here -- not enough to make we want to switch from TextMate + iTerm, though. Here are a few things I wished for in my hour working in RubyMine.

  • autotest-style functionality

  • ability to run a single spec, or nested block of specs

  • a console to execute arbitrary ruby code in the current context while stopped at a breakpoint

6 comments
Comment actions Permalink

Hi Luke,

>ability to run a single spec, or nested block of specs
RubyMine allows you to excecute spec file or all specs in folder.

>a console to execute arbitrary ruby code in the current context while stopped at a breakpoint
You can use "Evaluate Expression" dialog - Alt + F8. In future versions it will support autocompletion from scope at current execution point. May be we should improve it?

Edited by: Roman.Chernyatchik on Nov 9, 2008 10:23 AM

0
Comment actions Permalink

Luke Melia wrote:

  • autotest-style functionality

  • ability to run a single spec, or nested block of specs

  • a console to execute arbitrary ruby code in the current context while stopped at a breakpoint


Great suggestions.

My main gripe with RubyMine right now is code inspection. I believe RM
should only flag something as a warning/error when it's sure about it.
For example, if it can't determine the type of an object, it shouldn't
complain about unknown methods.

I know this would greatly diminish the scope inspections can be
correctly applied, but I'd rather have fewer, correct inspections than
have all my code flagged with warnings.

-- Marcus

0
Comment actions Permalink

Hello Marcus,

My main gripe with RubyMine right now is code inspection. I believe RM
should only flag something as a warning/error when it's sure about it.
For example, if it can't determine the type of an object, it shouldn't
complain about unknown methods.


That's in fact exactly how it works. :) Could you please show a code example
where you get an inspection error that is incorrect in your opinion?

(The vast majority of incorrectly yellow code, as far as we can see, is caused
by different dynamic stuff happening in Rails that injects unqualified names
in the current context. We're working on recognizing more cases like that,
but there is no simple rule that would let us know whether we're sure that
the warning is correct. :) )

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Dmitry Jemerov wrote:

(The vast majority of incorrectly yellow code, as far as we can see, is
caused by different dynamic stuff happening in Rails that injects
unqualified names in the current context. We're working on recognizing
more cases like that, but there is no simple rule that would let us know
whether we're sure that the warning is correct. :) )


(This is going to be a long)

Unfortunately Ruby is a very dynamic language, so maybe trying to flag
seemly unexistent methods is a fool's errand after all, and I'd rather
not have warnings at all than have incorret warnings. Then again, the
work you guys are doing a great work, and if it does get to the point of
being correct 100% of the time, it would be amazing.

The problem now is, when you get used to spurious warnings, you start to
ignore them completely, shooting down the whole point about having
inspections in the first place.

But alright, here we go. I'm currently working on a standard Ruby on
Rails (2.1.1), sitting in "vendor/rails" plus a few plugins and gems,
sitting respectively in "vendor/gems" and "vendor/plugins". Nothing
non-standard here.

Here are some incorrected highlighted warnings I've seen (IDEA #9013,
Ruby plugin 2.0.212928):

1) Methods added from plugins (both class and instance methods).
2) Named route methods (route_url, route_path).
3) Model associations access/assignments.
4) Model boolean attribute accessors (attribute?).
4) caches_page and cache_sweeper class method.
5) Many incorrected type inferences, with messages like "xxx does not
seem to have method...".
6) Module methods.
7) Template instance variables.

There are also a lot of JavaScript/HTML/CSS inspections that break
completely when dynamic generation(ERb) is involved. Worse, some of
these have no way to turn off:

1) JavaScript's "expression expected" when most of the expression is ERb
output.
2) HTML's "invalid id reference" when you have dynamically generetad fields.

Also a valid, but questionable inspections:

1) JavaScript's "unterminated statement" in inline HTML event handlers.
Yes, the statement is unterminated. But maybe inline handlers should be
exempted from this, since a final ; is almost never used.


That's it for now, I guess. Sorry for the long rant, but I hope it helps
you.

For example, the ActiveRecord::Base.paginate instance method added
by will_paginate, or the authenticate_with_open_id class method added by
open_id_authentication.

Apparently IDEA isn't using Rails from vendor/rails, but from a
locally installed gem. This would explain many methods recently
introduced to rails flagged as unknown.

http://jetbrains.net/jira/browse/RUBY-2222

For example, ERB::Util::html_escape

-- Marcus Brito

0
Comment actions Permalink

Hello Marcus,

Thanks a lot for a detailed post! We're already aware of many of the issues,
but not all of them - we'll be looking into that in more detail.

Two quick comments:

- You can go to Settings | Errors and turn off the "Unresolved Ruby reference"
inspection. This will get rid of most of the yellow.

2) Named route methods (route_url, route_path).


This is actually supposed to work. :) Could you please file a JIRA issue
and attach your routes.rb and a sample of the yellow code?

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Dmitry Jemerov wrote:

Thanks a lot for a detailed post! We're already aware of many of the
issues, but not all of them - we'll be looking into that in more detail.


I'm glad it helped.

- You can go to Settings | Errors and turn off the "Unresolved Ruby
reference" inspection. This will get rid of most of the yellow.


I know, that's what I do when actually working. I turned on all default
inspections to compose that post. I can't find inspection problems with
inspection turned off, right? :)

>> 2) Named route methods (route_url, route_path).


This is actually supposed to work. :) Could you please file a JIRA issue
and attach your routes.rb and a sample of the yellow code?


I think I've isolated the problem. IDEA is recognizing most routes,
except those with a :name_prefix and the root route. I've created
separate issues for those cases:

http://jetbrains.net/jira/browse/RUBY-2276
http://jetbrains.net/jira/browse/RUBY-2277


-- Marcus

0

Please sign in to leave a comment.