[Kde-bindings] KDevelop ruby support

Richard Dale Richard_Dale at tipitina.demon.co.uk
Sat Oct 23 10:09:50 UTC 2004


On Friday 22 October 2004 14:16, Thibauld Favre wrote:
> Le Vendredi 22 Octobre 2004 13:08, Richard Dale a écrit :
> > I would say the advantage of the build step is that you can invoke the
> > make rules to generate ruby source from the .ui files via rbuic. I think
> > there is a run button, so that probably builds and runs. It doesn't quite
> > work yet because I think it is expecting the ruby scripts to be in the
> > top level of the project, rather than under src.
>
> Ok but I have another pb with executing my app (==clicking first button on
> the left) that you might have already faced : Even if I set up kdevelop to
> execute the app from the app directory ("where the executable is"),
> KDevelop launches "ruby /home/[path]/project.rb" and of course it cannot
> start as the program doesn't find its required classes. The solution I
> found is to use the other button (there are 2 "KDE wheel" button, I'm
> talking about the one on the right) which launches "./main.rb" but from the
> BUILD directory. To make that work, I had to change a project option to
> have KDevelop call ruby with "-C" argument : "ruby -C [path]"
> Did you have the same problem ? If yes, how did you solve it ?
No I haven't looked at what's going on, but launching with the complete 
program path sounds wrong. It should cd to the build directory, and run from 
there.
> By the way, what is the name of those 2 buttons in english ? In french, the
> translation is bad because they both have the same name : one is "execute"
> and the other one is "execute the program" ...... eh ??? :)
In English they're 'Run' and 'Execute Program', so that sounds wrong.

> > Thanks. I've only spent about a day or so on it, but I think I already
> > prefer it to Kate because class browser makes it so much easier to find
> > things. Next I want to add slots/signals declaration navigation to the
> > class browser, and allow multi-line attr declarations. And a few more
> > templates, like a DCOP service, and improve the existing qtruby one so it
> > is a port of the C++ qmakeapp with a main window and menus etc.
>
> Great ! I also put I list of features I'd like to implement in Kdevelop
> when I have time. That includes :
> - Support ruby code folding in kate.(that will be the first thing I'll do)
Yes, that would be good. I don't know what it involves. You need to be able to 
find the matching 'end' for statements, and method definitions.
> - Doc generation
> - Code completion : do you think it's doable with ruby ? So far I have
> absolutely no clue about how that works so I really can't tell if it's
> realistic
I don't know what's involved either yet. The Smoke library allows you to look 
up methods for a class, so it could be driven off that if we linked against 
the lib. If we wanted to write ruby support in ruby we would need to do that 
anyway. I visual front end for the debugger would be nice.

> - Being able to execute the last version launched that didn't crash (even
> if we changed some code since then). It's a normal behavior for compiled
> language (as long as you don't try to rebuild) but it's a feature for
> scripting languages...
Just save in a hidden temp directory I suppose
> - Manage cross references in an entire project to be able to quickly see if
> you wrote a wrong variable name. Indeed, the error I do most when I code is
> mispelling (ex : I use "@ContratLbl" instead of "@ContratsLbl"...). As
> there's no compile time check, it's difficult to spot these errors and
> worst of all, as long as you don't execute the portion of code with an
> error, you don't even notice that your program has a bug. 
I don't know if ctags has ruby support, if it does that would save needing to 
write something.
> This scares me 
> and I try to find ways to check that my code seems to be correct without
> having to code and run a lot of tests :
> 1) Code completion, this way you're sure you're using the right variable.
> But you cannot use code completion everywhere....
> 2) Cross references : I'd like to have a left panel in kdevelop where I can
> see the number of occurences of each variable I use in my code. This way we
> can immediatly see the variables used only once : they are probably
> variables mispelled.
So that could be front end for ctags - I assume there already is one for C++.

> I'd be interested to have your views on this problem. Script languages are
> great but they become a lot more error prone to  sleeping bugs due to
> syntax errors when code grows. Of course we can fix the problem real quick
> but "only once we found it".
I have trouble if a leave an 'end' off, because all you get is an error 
message about the last line of the file and it's quite hard to track down. If 
would be nice to be able to select 'def' in a method and have the matching 
'end' highlighted.

-- Richard



More information about the Kde-bindings mailing list