This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: SchemeScript and code completion
* Per Bothner [2007-11-07 06:38+0100] writes:
>>> Since I write lot of Scheme code that interfaces with Java, the Java
>>> method completion is quite useful. Actually, If possible, Schemeway
>>> should do it even better, such as completing not only static method
>>> names, but also normal method names as in
>>> (let
>>> ((l :: <java.util.List> (make <java.util.LinkedList>)))
>>> (l:add 42))
>>>
>>> in this case, the l:add could be autocompleted.
>
> That requires integrating the compiler (specifically
> type checking) to be integrated with the IDE, which
> is difficult.
Could you explain why that is difficult? Is it difficult because the
internals of the compiler aren't prepared for such use or perhaps
because Scheme/Kawa is hard to analyze?
My naive approach to perform the above completion would be to parse
the source file --with something like kawa.lang.CompileFile:read,
ignoring non-parseable source for the moment--, then use the current
cursor position to find the corresponding node in the syntax tree, and
finally enumerate (somehow) all method/variable names accessible in that
node. What do you think of such an approach?
Helmut.