I don't think you and I are speaking of the same thing...
I tried CTRL-SHIFT-T in eclipse and that was a function that searched for
class names. What I was talking about was method completion on an object.
What I would like to do i something like this:
(custom-set-variables
;; ...
'(jde-complete-function (quote jde-complete-ido))
;; ...
)
;; In jde-complete.el
(defun jde-complete ()
(interactive)
(funcall jde-complete-function (jde-complete-find-completions-at-point)))
;; In your own dot files
(defun jde-complete-ido (methods)
(interactive)
(jde-complete-insert-completion (ido-completing-read "Method: " methods)))
(defun jde-complete-anything (methods)
;; ...
)
jde-complete-find-completions-at-point is a defun that will find all
possible completions at point. methods argument for jde-complete-ido and
jde-complete-anything is what is sent from jde-complete
(jde-complete-find-completions-at-point). This way you can really easy
choose your own completion method if none of the once in jde-complete suites
you. jde-complete-insert-completion is a defun that would remove the
characters that is already typed so thats not repeated.
You see what I mean?
BTW:
I kinda like the CTRL-SHIFT-T function in eclipse. If you want to implement
it, this is a way you could search with a regular expression.
public List getAsList(Object key) {
List<Object> li = new ArrayList<Object>();
for(Object o : this.keySet()) {
if(Pattern.matches(".*" + key + ".*", (String)o)) {
Object value = this.get(o);
if(value instanceof List) {
li.addAll((List)value);
} else {
li.add(value);
}
}
}
return li;
}
This way though is way more expensive than the previous version.
On Fri, Jan 23, 2009 at 3:55 AM, Paul <[email protected]> wrote:
> Ah, I see. I've wanted something similar. Like a more sort of auto
> complete like CTRL-SHIFT-T in eclipse where you have a list of
> completions, correct?
>
> Unfortunately, the rendering of completions is done in Java. While a
> list does come back, it's a list of fully qualified class names that
> match the class (think file name) of the class currently. I've not
> looked at the Java code in a while, but I'm sure it would be somewhat
> easy to change the code to return anything that matched, say, a
> regular expression or something as such instead.
>
> Take a look and submit a patch if you care to or have the time.
>
> The class/method of interest is:
>
> jde.util.JdeUtilities.getQualifiedName(String)
>
> Regarding the next release, it was to be out a month ago :) But then
> I my contract wasn't renewed and all of my energy has gone into
> finding, then getting ramped up on my current contract.
>
> Such is the way of life with open source these days. Doesn't it seem
> like everyone use to have time for it?
>
> Things are beginning to slow down and I imagine something substantial
> will be out within the next two months or sooner.
>
>
> Johan Andersson writes:
> > Hi Paul and thanks for your answer.
> >
> > I have looked some in the source code. But I didn't find any good way to
> > solve my problem without copying pretty much all code from
> > jde-complete-generic and jde-complete-pair.
> >
> > Since there is jde-complete-function I thought that there was some
> function
> > that figured out all completions (with the beanshell) and that returned
> a
> > list of all completions. This way it would be easy to use modes such as
> ido
> > and anything. That was what I was trying to achive.
> >
> > Just out of curiosity, when will there be a next release and what
> features
> > will it include? I didn't see any notes about it on the homepage.
> >
> > On Thu, Jan 22, 2009 at 3:47 AM, Paul <[email protected]> wrote:
> >
> > > I suggest looking at the current source code. It uses beanshell to
> > > traverse the classpath. In return, beanshell returns a list as a
> > > sexp, which Emacs then reads and uses `completing-read'. Or wait
> > > until the next release, which will have an improved version which
> > > might address your needs.
> > >
> > > Johan Andersson writes:
> > > > Hi,
> > > >
> > > > I'm trying to create my own custom function to jde-complete. But I
> cant
> > > > figure out how to get the list of completions without activating
> some
> > > other
> > > > completion method.
> > > >
> > > > Could someone please give me a short example of how this could be
> done?
> > > >
> > > > Thanks!
> > > > Hi,<br><br>I'm trying to create my own custom function to
> > > jde-complete. But I cant figure out how to get the list of completions
> > > without activating some other completion method.<br><br>Could someone
> please
> > > give me a short example of how this could be done?<br>
> > > > <br>Thanks!<br>
> > > >
> > >
> ------------------------------------------------------------------------------
> > > > This SF.net email is sponsored by:
> > > > SourcForge Community
> > > > SourceForge wants to tell your story.
> > > >
> > >
> http://p.sf.net/sfu/sf-spreadtheword_______________________________________________
> > > > jdee-users mailing list
> > > > [email protected]
> > > > https://lists.sourceforge.net/lists/listinfo/jdee-users
> > >
> > > --
> > >
> > Hi Paul and thanks for your answer.<br><br>I have looked some in the
> source code. But I didn't find any good way to solve my problem without
> copying pretty much all code from jde-complete-generic and
> jde-complete-pair.<br>
> > <br>Since there is jde-complete-function I thought that there was some
> function that figured out all completions (with the beanshell) and that
> returned a list of all completions. This way it would be easy to use modes
> such as ido and anything. That was what I was trying to achive.<br>
> > <br>Just out of curiosity, when will there be a next release and what
> features will it include? I didn't see any notes about it on the
> homepage.<br><br><div class="gmail_quote">On Thu, Jan 22, 2009 at 3:47 AM,
> Paul <span dir="ltr"><<a href="mailto:[email protected]">
> [email protected]</a>></span> wrote:<br>
> > <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204,
> 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I suggest looking
> at the current source code. It uses beanshell to<br>
> > traverse the classpath. In return, beanshell returns a list as
> a<br>
> > sexp, which Emacs then reads and uses `completing-read'. Or
> wait<br>
> > until the next release, which will have an improved version which<br>
> > might address your needs.<br>
> > <div><div></div><div class="Wj3C7c"><br>
> > Johan Andersson writes:<br>
> > > Hi,<br>
> > ><br>
> > > I'm trying to create my own custom function to
> jde-complete. But I cant<br>
> > > figure out how to get the list of completions without
> activating some other<br>
> > > completion method.<br>
> > ><br>
> > > Could someone please give me a short example of how this
> could be done?<br>
> > ><br>
> > > Thanks!<br>
> > </div></div> > Hi,<br><br>I&#39;m trying to
> create my own custom function to jde-complete. But I cant figure out how to
> get the list of completions without activating some other completion
> method.<br><br>Could someone please give me a short example of
> how this could be done?<br><br>
> >
> > > <br>Thanks!<br><br>
> > >
> ------------------------------------------------------------------------------<br>
> > > This SF.net email is sponsored by:<br>
> > > SourcForge Community<br>
> > > SourceForge wants to tell your story.<br>
> > > <a href="
> http://p.sf.net/sfu/sf-spreadtheword_______________________________________________"
> target="_blank">
> http://p.sf.net/sfu/sf-spreadtheword_______________________________________________
> </a><br>
> > > jdee-users mailing list<br>
> > > <a href="mailto:[email protected]">
> [email protected]</a><br>
> > > <a href="
> https://lists.sourceforge.net/lists/listinfo/jdee-users" target="_blank">
> https://lists.sourceforge.net/lists/listinfo/jdee-users</a><br>
> > <font color="#888888"><br>
> > --<br>
> > </font></blockquote></div><br>
>
> --
>
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
jdee-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jdee-users