01 March 2010

Ruby Language Support In KDevelop4

It's been more than a week since I got back from Kate and KDevelop Hacksprint we had in Berlin, but I feel it's never late to write a blogpost about it.

The hacksprint was full of hacking, drinking awesome German beers, socializing, sightseeing and many more. I have to say I enjoyed every minute of it. Many thanks for Milian for organizing this event!

This time I set up a bold goal for myself. I had to make KDevelop 4 good for my everyday work and finally stop using KDevelop 3. For that to happen I had to do three simple things:
1) don't let C++ parser to take all my memory when opening Ruby interpreter sources
2) have proper X session management support to correctly reopen all my running KDevelop sessions at X startup
3) implement Ruby language support (at least) with the same feature set as in KDevelop 3

Thanks to a good beer and to a good company, I did everything I planned!

Ruby Support

Ruby support features we have so far in KDevelop 4 are:
  • Ruby application template
  • Ability to open existing projects with Generic Project Manager

  • Quick Open Files/Classes/Functions and a Class View
  • Outline and Previous/Next Function navigation

  • Rails-specific switching between controllers/models/views/tests

  • Run Current File feature with automatically created launch configuration
  • Run Current Test Function (works only for Test::Unit framework), again with automatically created launch configuration

I've imported Gitorious project (yeah, it's Ruby on Rails!) to illustrate my words.

Quick Open Function:

Rails-specific "Switch to View" navigation using regular Quick Open widget:

Run Current File:

See more screenshots at the Ruby support wiki page.

To try Ruby support yourself, you'll need to compile the plugin from playground yourself. I have no plans to release it yet, but if you'd like to test it or use it for everyday work, please do. I'm writing Ruby code with KDevelop4 every day now, so the Ruby support is stable and I intend to keep it that way in the future.

This is only the beginning. Ahead is the long way to a best possible Ruby support in KDevelop 4. Stay tuned!


illissius said...


C++, Ruby, Haskell, and maybe D are the three (four) languages I care about, so this is welcome news indeed.

david said...

thanks adymo!!!

Anonymous said...

awesome news, keep it up

rdale said...

Great work!

I'll try and add some project templates for QtRuby, Korundum and Plasma Ruby projects.

There was one thing that KDevelop3 had that is still missing - a Ruby debugger. That would be a perfect Google Summer of Code for somebody perhaps.

Anonymous said...

Is there intellisense support for built-in functions?

Anonymous said...

Good to know, I hope that the support to RoR will be the same as we have with netbeans, in that case i'll move surely to kdevelop :)

Alexander Dymo said...

rdale: cool! Btw, I'll start integrating your parser soon, I'd appreciate your help with that too :)

And yes, debugger is missing... Let's see if we get somebody interested in working on it. Should be much easier to do than it was during KDevelop3 times. The framework/widgets is more abstract now.

anonymous: intellisense (aka code completion in KDevelop world) isn't yet there. It's very hard to write proper completion for dynamic languages because most of the time you need to guess about the type of expression under the cursor. But anyways, expect us to have at least completion for obvious cases soon.

another anonymous: not sure we'll match with Netbeans soon, but I'm using this every day and I'll keep implementing features until I make KDevelop a good RoR IDE. Then we'll compare :)

elvis said...

Awesome! I guess maybe you hit the Ballmer Peak? http://xkcd.com/323/ :)

Alexander Dymo said...

Exactly! Carefully measured, constant supply of beer is what made us productive ;)

The User said...

Do not read such blog-posts, simply perform `svn up` in kdevelop4-extra-plugins. I did and I was about about every new file. Ah, some rails-specific-stuff, ah, some Duchain stuff... That is real fun. :D
(I do not want to critisize this article)

C++ - the language
Ruby - the simple and clear language
Haskell - the pure language
PHP - the dirty web-language
D - better C++ without KDE-support

One key-concept is missing: Scheme, the impure, clear language. ;)


..::Kanniball::.. said...

There is a lot of demand for a decent ROR ide... I think Kdevelop could be the perfect match, to get people away from the resource hungry Java's IDEs.

Good work and I hope you decide to release this asap.

saLOUt said...

Nice to see things going on in ruby kde land.

Kevin Kofler said...

If it's stable, why is it only in playground? Wouldn't it make sense to ship this with the KDevelop4 releases coming soon?

Alexander Dymo said...

Because it's unfinished and it will be for the next couple of months. Will release only when ready.

The User said...

I can't find the .g-file in SVN...

The User

Anonymous said...

must have feature:
- code formatting
- git integration (as kdevelop4), i don't know if it's already there
- good support for testing (rspec + autospec)

then i'll move to kdevelop4 :)

Alexander Dymo said...

Anon: your voice is heard :)
Btw, git plugin is in playground as well, but I don't know whether it works.

Anonymous said...

@alexander: thanks... another very nice feature would be a good support for view/erb files (autocompletion and code color), both for ruby and html stuff (like show when tags are not closed, autocompletion for closing them, etc)

Jose Luis said...


First congrats, looks amazin! I'm having troubles compiling:
Kde 4.4.0 - kdevelop 0.9.98

Scanning dependencies of target kdevrubynavigation
[ 29%] Building CXX object navigation/CMakeFiles/kdevrubynavigation.dir/kdevrubynavigation_automoc.o
[ 35%] Building CXX object navigation/CMakeFiles/kdevrubynavigation.dir/railsswitchers.o
/usr/local/src/ruby/navigation/railsswitchers.cpp: In member function ‘void Ruby::RailsSwitchers::switchToView()’:
/usr/local/src/ruby/navigation/railsswitchers.cpp:165:20: error: ‘class KDevelop::IQuickOpen’ has no member named ‘showQuickOpen’
/usr/local/src/ruby/navigation/railsswitchers.cpp: In member function ‘void Ruby::RailsSwitchers::switchToTest()’:
/usr/local/src/ruby/navigation/railsswitchers.cpp:308:20: error: ‘class KDevelop::IQuickOpen’ has no member named ‘showQuickOpen’
make[2]: *** [navigation/CMakeFiles/kdevrubynavigation.dir/railsswitchers.o] Error 1
make[1]: *** [navigation/CMakeFiles/kdevrubynavigation.dir/all] Error 2
make: *** [all] Error 2

Any help is aprecciated!

Alexander Dymo said...

Jose: looks like you need newer kdevplatform (0.9.99). Just download and install kdevelop+kdevplatform beta9 (released yesterday). It should work fine.

Btw, don't forget to svn up ruby plugin sources. I've fixed another compilation error yesterday.

cga said...


first things first: thank you for your work. Ruby integration is very much needed in kdevelop4.

i have a simple question: i don't understand why if i issue svn co from commandline i get revision 1160660 and if i automate svn co in a PKGBUILD (arch package which i'm trying to make in order to upload it for users of this distro) i get revision 1144334.

can you help me on this?

ps: the PKGBUILD builds fine and install no problem, i get some ruby feature in kdevelop4 but not all the ones shown in this very blog post.

Anonymous said...

It be in KDE4.5 ?

Atalargo said...

Hi. I'm very interested by your plugin, but i use the version 4.2 (last stable) of Kdevelop. And your plugin isn't compatible with (compilation error).
Do you work on it to upgrade to a new compatible version or not?

(if not , i'll try to modify it myself)


Alexander Dymo said...

Atalagro: I've updated the plugin to KDevelop trunk. In theory it should work with 4.2. If not, it still should be easier to fix now.