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?

--
eric

Reply via email to