From: timsuth@... (Tim Sutherland) Date: 2004-10-30T13:13:56+09:00 Subject: Re: Auto-completion editor/IDE In article <525df23a04102819497e4d53ff@mail.gmail.com>, Rob . wrote: >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. [...] Nice! This is a clever idea. How well does it work?