On 4/21/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
>
> Eric Van wrote:
>
> > It appears that code completion is removing any entries that have
> > duplicate 'word' attributes.
> >
> > For completion results not using the dictionary format I fully agree
> > that duplicates can safely be removed, but when using the dictionary
> > format two or more entries sharing the same 'word' attribute should
> > not be considered duplicates.
> >
> > For instance, performing code completion on the following java code
> >   String name = ...
> >   name.to<C-X><C-U>
> >
> > My code completion function returns a list with the following entries:
> >   kind: 'f', word: 'toCharArray', menu: 'toCharArray()  char[] - String'
> >   kind: 'f', word: 'toString',         menu: 'toString()  String - String'
> >   kind: 'f', word: 'toUpperCase', menu: 'toUpperCase()  String - String'
> >   kind: 'f', word: 'toUpperCase', menu: 'toUpperCase(Locale locale)
> > String - String'
> >   kind: 'f', word: 'toLowerCase', menu: 'toLowerCase()  String - String'
> >   kind: 'f', word: 'toLowerCase', menu: 'toLowerCase(Locale locale)
> > String - String'
> >
> > But vim removes the 4th and 5th entry since they have the same 'word'
> > value as the entry before them (at least I assume that is why they are
> > removed).  As a user I then never get to see that String has a
> > toUpperCase and toLowerCase that take a Locale as an argument.
> >
> > So I suggest either removing duplicate checking when results are in
> > the dictionary format, or at the very least, check the 'menu'
> > attribute along with the 'word' attribute to determine if an entry is
> > a duplicate, however that may or may not work for everyone.
> >
> > Thoughts? Comments?
>
> Since we are talking about completion, there is only one word to be
> completed "toLowerCase".  That it can have different arguments doesn't
> matter for inserting "toLowerCase".  You could have a function name ten
> times and need to type CTRL-N ten times to get to another word.
>
> I suggest you put alternate function arguments together with one word.
> Thus "toLowerCase" would have a menu item and info that shows both
> possible forms of arguments.

Should vim be dictating this?  I've never used an IDE that behaved in
this fashion.

If vim leaves duplicate handling up to the script developer then we
can decide which form is most appropriate for the situation, and
perhaps provide our own configuration for letting the user decide
which they prefer.

While I agree that providing the sigurature for all variations in a
single 'info' would work, what about if I want to use 'info' for a
description of the method?  If I have ten variations how much is the
user going to have to sift through to get a description of the method
their looking for?  Instead of Ctrl-N x amount of times, they have to
exit completion mode, switch to the preview window and begin
searching.  Which do think would be more convient?


To Martin:
  http://eclim.sourceforge.net
  A new release should be out in the next week or two once I resolve
some of these completion peculiarities.

--
eric

Reply via email to