From: "Rob ." Date: 2004-10-29T11:49:33+09:00 Subject: Re: Auto-completion editor/IDE I wrote a jEdit macro and ruby script that performs na�ve code completion using ri. Currently it runs incredibly slow, but as a proof of concept it was a success. My na�ve approach is to assume that if it quacks like a duck, it probably waddles like a duck too. Unfortunately if we haven't heard any quacks yet, then it's difficult to assume waddling or anything else. The jEdit beanshell macro executes a Ruby script that does the following: 1) determines methods that have already been called on the variable 2) uses a slightly modified version of ri to find classes that have all those methods 3) uses ri again to find all the methods available on those classes The jEdit macro then displays a popup list of the methods for the user to select from. In the case of a variable being declared like this: variable = Duck.new we know we have a duck so the script can immediately jump to step 3. A faster implementation would be to leave the ruby process running so we keep the ri cache in memory. We could connect to the process from jEdit over a socket or http. jEdit is a programmers text editor written in Java. I've released some useful jEdit macros for Ruby editing, including my favourite "auto-indent and insert end": http://community.jedit.org/cgi-bin/TWiki/view/Main/MacrosForRuby I'm thinking of developing a fully fledged jEdit plugin for Ruby editing, leveraging ideas from the Eclipse Ruby Development Tool (RDT), my existing macros and Intellij IDEA.