No Ruby code completion or code navigation with IntelliJ 9.0.3 + Ruby Plugin 2.5

I'm using the latest of both IntelliJ and the Ruby plugin (2.5.13234) on Mac OS X and am really surprised that no code navigation or code completions work at all. About once a week, under some conditions I haven't determined yet, I notice by accident that code navigation (by holding the command key and hovering over a symbol) will start to work only to find that the next time I try it, it's broken again.

I have a feeling that there is something borked in my installation since I don't see any other people mention this issue. Any help would be greatly appreciated. IntelliJ is seriously neutered without this stuff working.

Thanks,

Michael

11 comments
Comment actions Permalink

Since IntelliJ was up against the default memory limits pretty hard, I increased the heap size to 1 GB as an experiment. I can't tell for sure if it helped or not. It seems that I get code navigation (via hyperlinks) more often than before, but I have yet to see a single code completion happen in 4 weeks of using IntelliJ for Rails development. Does this stuff actually work for everyone else or am I just beating a dead horse here?

0
Comment actions Permalink

I also found a related problem from a couple years ago: javascript:;

Someone in that thread seemed to think that it was related to ruby 1.8.6 vs 1.8.7, but my Mac only has 1.8.7 installed. This is driving me nuts...how can the world's best IDE not have auto completion?

0
Comment actions Permalink

Hello Michael,

The Ruby plugin for IntelliJ IDEA certainly does have auto-completion.

Is the .rb extension assigned to the Ruby file type in Settings | File Types?
Are the Ruby files in which you're trying to use code completion located
under a content root of the project? Does the project have a Java or Ruby
module type?

I also found a related problem from a couple years ago:

Someone in that thread seemed to think that it was related to ruby
1.8.6 vs 1.8.7, but my Mac only has 1.8.7 installed. This is driving
me nuts...how can the world's best IDE not have auto completion?


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


0
Comment actions Permalink

Hi Dmitry,

Yes the .rb extension is assigned to the Ruby file type, and so are many others (*.gemspec, *.rake, *.ru, cucumber, and many more...). The code is in a normal Rails project structure which IntelliJ seems to be fully aware of. I can switch the 'View as:' dropdown in the Project tool window to 'Rails' and everything looks good. Even Command-N works for bringing up Ruby classes by name. There is only one module in the project and it is a Ruby module with a 'Ruby on Rails' facet (3.0.1). All the gems are detected, installed and attached to the 'Ruby SDK 1.8.7' sdk. All source files are under the content root which is the base of the Rails project.

The IntelliJ project was created after the rails command line was used to create the skeleton.

Michael

0
Comment actions Permalink

I was wondering if there is a problem with my imported project so I decided to created a fresh one. The fresh project has the same problems as with the original imported project:

working:

  • syntax highlighting
  • Command-N for loading classes
  • full rails project structure is detected
  • debugger
  • unit tests
  • generators
  • rake tasks


broken

  • completions
  • code navigation
  • find usages
  • refactorings,
  • etc...basically any code structure intelligence is missing


BTW, I also applied the 9.0.4 patch yesterday and it made no difference either.

I'm hoping that if I keep providing details that it might trigger a neuron for someone, somewhere. I *really* want to get this working.

0
Comment actions Permalink

I have a very similar setup to Michael (9.0.3 recently patched to 9.0.4) and am having the same problems:  (Refactoring and code completion don't work, etc.)  I've been looking for posts on this issue for two weeks and am also surprised that I've only come across one (Michael's).


Here's something interesting:  Last night I was using RSpec for the first time and ran across a bug that I thought had been fixed:  I had to change line 201 in formatter.rb


example, failure = args[0], args[2]
from
example, failure = args[0], args[1]


(See the comments in http://youtrack.jetbrains.net/issue/RUBY-6355 for details.)

Perhaps my build still has some other old code in it somehow.

0
Comment actions Permalink

As in, maybe the patch mechanism is not equivalent to a full install? I'll give that a try.

Michael

0
Comment actions Permalink

Nope, I installed the full 9.0.4 but it made no difference.

0
Comment actions Permalink

Hello Michael,

Nope, I installed the full 9.0.4 but it made no difference.


Are there any exceptions in idea.log when you try to use the code completion?

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


0
Comment actions Permalink

Actually, I assumed that since the UI wasn't indicating errors that there were none. However, it turns out that there are a ton of errors when trying to invoke completion...or at least the same error is logged over and over again. See attached log file for details.

Thanks for the suggestion (can't believe I hadn't looked there yet).

Michael



Attachment(s):
idea.log.zip
0
Comment actions Permalink

I just found the following bug: http://youtrack.jetbrains.net/issue/RUBY-5994 that appears to be my problem. That bug references http://youtrack.jetbrains.net/issue/RUBY-6452 which has a workaround suggested.

I used Roman's first workaround and it worked for me.

0

Please sign in to leave a comment.