3

I'm new to Rails and need to get my Eclipse DLTK highlighting working.

It is occasionally giving syntax error, unexpected ':' for hash colon notation. Though the application runs fine.

I'm using Eclipse Indigo and the Ruby Development Tools.

benedict_w
  • 3,543
  • 1
  • 32
  • 49

3 Answers3

5

So, unfortunately, this is still an issue in Eclipse, and it's driving me crazy.

Both the Eclipse DLTK project (for both Indigo and Juno) and the Aptana Studio plugin for Eclipse -- all have this issue. Here's the relevant bugs, still open and unaddressed:

1) https://bugs.eclipse.org/bugs/show_bug.cgi?id=386350

2) http://jira.appcelerator.org/browse/APSTUD-4405

It's enough to make me overcome the usual switching IDE inertia, so I'm currently evaluating RubyMine (it does not have that syntax error problem, as I just tested, and is an excellent Ruby IDE from everything I've been able to read).

[edit] For what it's worth, I also just submitted a patch for this issue on the dltk.ruby github repo.

Dmitri Zagidulin
  • 1,117
  • 9
  • 23
  • I've been running Ruby Mine - it's excellent. I don't have all that many projects in RoR yet but if I did I would certainly buy it. Am also thinking of ditching Eclipse for PHP and finding something specifically tailored for it. Thank you for your answer! – benedict_w Oct 21 '12 at 09:03
  • 1
    Oddly enough, Eclipse is actually pretty good for PHP! :) It's the Ruby part that's been neglected. – Dmitri Zagidulin Oct 21 '12 at 17:24
  • I used it with PHP for years, but seeing all the features in Ruby Mine like code completion and debugging has reminded me what I'm missing. Every time I update something xdebug seems to break! Also eclipse is so slow! – benedict_w Oct 21 '12 at 18:34
1

As of today, I like Idodds answer best: use DLTK 5.0 which appears to be the only option both (modestly) maintained and (modestly) functional. I had to crawl through some nasty internets to find the answer to "how to actually install DLTK 5.0" since all the search results send you to update sites which gives you DLTK 2.0 at best. I finally found this, which was the best I encountered for getting 5.0 on newer eclipse luna (newer than Kepler which Idodds detailed):

http://download.eclipse.org/technology/dltk/updates-dev/5.0/

When I used that update site (and de-selected "show in groups" since they've misconfigured this plugin). Then I just selected the two options I wanted: "Ruby Development Tools" and "Ruby Development Tools SDK" (which in turn required the core plugin). PLEASE NOTE: I also made very sure to confirm the "Version" looked something like "5.*" which it did in this site (and definitely did not in the others).

enter image description here

PostScript: the other two:

RDT: I've been using RDT for almost a year now with ~0 success. it does a modest job of syntax highlighting, but it does a comprehensive job of crash-and-burning on ruby 1.9 syntax. I wish internet/google would flag RDT as deprecated: a plugin which supports ruby 1.8 and prior really should not be listed in current "ruby" search results.

Aptana gets some very good press, and some very bad press. I should try it, since I need Rails not just ruby, but the bad press seems pretty comprehensive, so I've avoided it. I tried a few times and failed, but of course any non-java eclipse plugin will probably take a few days to make work.

Benny
  • 61
  • 1
  • 2
  • oh n.b. I do not explicitly say it, but once I did this and configured up a ruby project (not sure how much of that was magic, and how much of that config i did correctly), it is indeed parsing/highlighting as good or ~better than RDT did, but it does not issue errors for {foo: "bar"} map syntax. (and it does issue errors for proper errors, and seemingly-reasonable warnings) – Benny Apr 01 '15 at 23:32
  • "ruby" means versions 9.3 or later: https://www.ruby-lang.org/en/news/2014/07/01/eol-for-1-8-7-and-1-9-2/ – Benny Apr 01 '15 at 23:42
  • "ruby" will soon mean version 2.0 or later: https://www.ruby-lang.org/en/news/2015/02/23/support-for-ruby-1-9-3-has-ended/ – Benny Apr 01 '15 at 23:49
0

This seems to be mostly resolved now. The main problem I encountered was with the new hash key syntax.

With Eclipse Kepler and DLTK 5.0 there are less errors. The syntax checker seems strict, but now works.

Using the Kepler release make sure you add the following as a Repository in "Install New Software":

http://download.eclipse.org/releases/kepler

Then install DLTK 5.0. The repositories that come bundled with Kepler don't seem to refer to the latest DLTK version which is why this issue looks like its not fixed.

ldodds
  • 249
  • 2
  • 4
  • 3
    Are you able to actually get syntax highlighting for the new-style ruby hash keys with this setup? I cannot. – KenB Aug 07 '14 at 20:58