* Sun 2000-01-30 Paul Kinnucan <[EMAIL PROTECTED]> list.emacs-jde
* Message-Id: <[EMAIL PROTECTED]>
| At 03:29 PM 1/30/00 +0200, Jari Aalto+mail.emacs wrote:
| >| Place cursor at end of partially completed field or method name and type
| >| C-c C-v C-.
| >|
| >| Note, due to a bug in the JDE "intellisense" code, the current source file
| >| must have an import statement for its own package, e.g.
| >|
| >| package mypackage;
| >| import mypackage.*;
| >|
| >| in order to complete fields and methods for classes defined by the current
| >| package. Also, note that the completion facility is based on Java
| >| reflection and hence works only for compiled classes.
| >
| >I tried to complete simple (in latest jde; Emacs 20.4)
| >
| >    import java.lang.*
| >
| >    System.out.<HERE>
| >
| >and the answer is: Can't find any declaration for ....
| >What is the excat setup that is needed for completion to work? The
| >ReleaseNotes.txt only mention that this function was added.
| >
|
| Nothing special is required. The reason it doesn't work in your case is
| that it requires the beanshell and the beanshell is not working in your case.

It seems that the jde.jar and bsh.jar must be xplicitedly defined in CLASSPATH,
not just the directory where they define. The (bsh) now starts but is
is never called.

       import java.lang.*
       import java.lang.System.*;

       System.out.<HERE>

The jde-complete-declared-type-of does some back tracking 
with  search-backward

       jde-complete-at-point
          (setq vtype (jde-complete-declared-type-of (car pair)))
          --> nil

    (defun jde-complete-declared-type-of (name)
      (save-excursion
        (let (found res pos orgpt resname)
          (while (and (not found)
>>                    (search-backward name nil t))
            (setq pos (point))
            (backward-word 1)
            (setq resname 
               (jde-complete-valid-java-declaration-at (point) name))
            (goto-char pos)
            (forward-char -1)
            (if (not (null resname))
                (progn (setq res resname)
                       (setq found t))))
        res)))

But it can't find anything like "System.out". I don't quite understand how
this completion code is supposed to work given these preconditions. There 
must be something else that is needed in .java file than just the import
clause.

jari

Reply via email to