Rubymine not taking qualified class names into account

I have a ruby class similar to the following:

require 'rack'
require 'rack/request'
require 'rack/response'


require 'some/other/http'


class Foo::Fee::Fum::Rack
  def zimba(arg)
    request = Rack::Request.new(arg)
    response = Rack::Response.new
    ...
  end
end

When doing inspect on this file I get an error on the Rack::Response.new informing me that it's missing two arguments. If I select this method and the use 'Go To' in the context method I end up in a class from the project file 'some/other/http/response.rb'. The name of the class found in that file is:

Some::Other::HTTP::Response

It seems like RubyMine completely disregards the fact that the name is qualified and chooses a class from the project source but in a different module instead of the correct one imported by the rack gem. The Rack::Request class on the line above does not have this problem. If I use 'Go To' on that class it ends up in the rack gem.

I have seen similar problems in other places where RubyMine seems to disregard the module hierarcy completely. What am I doing wrong?

5 comments
Comment actions Permalink

Hi,

the problem looks very similar to RUBY-15473 which (I believe) has been fixed in master and will be available in RubyMine 7.1.
If you provide a simple test project which demonstrates the problem I will verify that your problem is also fixed.

Regrads, Oleg.

0
Comment actions Permalink

Here's a sample project that demonstrates the problem in RubyMine 7.0.3. Look at the file lib/qname/foo/rack.rb. Another thing I discovered is that the class that contains the method where this fails has the same name (leaf name that is) as the class it fails to resolve correctly. Changing that name makes the problem go away so perhaps this is a different problem after all.

Thanks,
- thomas

0
Comment actions Permalink

Yes, it looks like the problem is not fixed yet.  Please file a ticket in our tracker (https://youtrack.jetbrains.com/issues/RUBY) with the test provided,
and I will look at it.

Regards, Oleg.

0

Please sign in to leave a comment.