[EMAIL PROTECTED] a �crit :
> I added this snippet to my prj.el some of you might find it usefull, tho it
> isn't working quite right.
> (provide 'geoffs-jde-tab)
> (define-key jde-mode-map [tab] 'geoffs-jde-tab)
> The original idea was that the first time you hit [tab] it would indent,
> the second time would call jde-complete-at-point.
> the third time would call dabbr-expand (or hippie-expand).
In fact, jde-complete-at-point already works exactly the same way as
dabbrev : the first call to jde-complete-at-point inserts the first
completion, and calling it again cycles through all the possible
completions.
What it does is the following : At the first call, it looks at the
current (preceding) word, and tries to extract the variable name.
Anything like "var.meth" is analysed as a variable "var" with a method
(or a variable name) that begins with "meth". The second step is finding
the type of the variable. So it backward-search for something that may
look like a declaration, eg. "name var;", "a.long.name var =", etc.
When such a name is found, it calls the jde.util.Completion class to
get back all the possible completion for this variable. Then, it builds
a completion list that can complete the "meth" method, or let every
possible choise, if the method is empty ("").
Of course, such a design _require_ to have the class already compiled
and added in the bsh classpath. I have reasons to think that relying on
the parser will give slow and non-robust results. Another method is to
used the TAGS file, but, hey, there's nothing inside that's not easily
available through java introspection.
There are still many situation that are not handled by the
jde-complete.el, but I believe the most common cases are handled OK.
> For some reason dabbr-expand/hippie-expand seem to work fine the first time
> they are called, but then screw up majorly the second time. It works fine
> when I map hippie-expand to [f3].
>
> I know I'm calling jde-complete-at-point as I get "No completion at this
> point." and "Can't find any declaration..." messages. Unfortunately, I
> can't ever get it to complete anything. (even using C-c,C-v,C-.) Has
> anyone had any luck with jde-complete-at-point?
Well, I had :-)
Make sure, your variable has its type defined, and that its class is
available in the bsh classpath. Otherwise, it's a bug. Try it with a
standard java class, like String or Vector.
--
Rodrigo.
Mes propos ne sont pas | #include <disclaimer>
ceux de mon employeur | Socrate: "vous dites que j'ai bu quoi ?"