Hi Eric,
you don't need to restart beanshell. It is sufficient to call jde-wiz-update-class-list. You can use C-c C-v C-q to call it.
This works quite well. But I think it would be even more convenient to have a compile-finish-hook which calls jde-wiz-update-class-list.
There is also menu entry which calls this function: JDE->Code Generation->Wizards->Update Class List Since jde-wiz-update-class-list is necessary for jde-import, submenu JDE->Interpreter (or even a new submenu) might be a better place for "Update Class List".
Regards,
Martin
Erik Curiel wrote:
I also notice that the jde-import suffers the same problem, that it won't be able to find newly created classes unless bsh is restarted.
Thanks!!!
Erik Curiel
On Thu, 5 Aug 2004, Paul Kinnucan wrote:
Robert Mecklenburg writes: > It often occurs that jde-complete says no completion at point when it > should not. In these cases, exiting and restarting the bean shell > cures the problem. One of the most common cases is when a new class > has been defined (after the bean shell has started). It seems to me > that a refresh-classes command for the bean shell would be useful > here. Does one exist? >
Hi Robert,
Completion for a new class will work only if the new class has been compiled. That is because JDEE's implementation of completion uses Java reflection to determine the names of a class's members. The JDEE provides a jde-compile-finish-hook function, jde-compile-finish-flush-completion-class, that is supposed to update the JDEE's completion subsystem after compilation of the class. What this function does is flush the JDEE's completion cache. The JDEE's completion cache is an Emacs Lisp variable that lists the members of all classes that have be completed since the beginning of the session or the cache has been flushed. Flushing the cache forces the JDEE to regenerate the completion info for the class that has just been recompiled. This may not work for new classes. The reason is that the Java side of the JDEE's completion subsystem maintains its own cache of all classes on the current project's classpath. This cache is updated whenever you switch projects. However, it's possible the cache is not being updated everytime you compile a class. Hence, the completion subsystem would never see a new class. I will investigate further this evening and if this is the case provide a fix in the next beta release.
Paul
