Community
Participate
Working Groups
Created attachment 271970 [details] content assist suggestions order Steps to Reduce: In Java Editor 1) Input 'FileU' 2) Press Alt+/ to call Content Assist Actual Result: The first suggestion Content Assist suggestion list is 'FilenameUtils' and the second is 'FileUtils'. Expected Result: The first suggestion is 'FileUtils' and the second is 'FilenameUtils'.
Much thought has already gone into sorting of proposals. Judging just from one example it's not clear how the algorithm should be changed. To make your request actionable it would be great if you could define a rule that would create the order you expect. Based on that we'd have to check if it conflicts with any existing rule.
Same problem in Open Type (see bug 527957).
(In reply to Stephan Herrmann from comment #1) > Much thought has already gone into sorting of proposals. Judging just from > one example it's not clear how the algorithm should be changed. For me it is clear: FileUtils is a closer match for FileU than FilenameUtil
(In reply to Dani Megert from comment #2) > Same problem in Open Type (see bug 527957). I thought the "perfect match" case was already fixed. Seeing (part of) it still unresolved I agree that the goal should be clear.
Once excluded the perfect match, we could sort the remaining entries by numeric rank = number of consecutive characters of the searchString found in the entry. example: searchString = "FileU" ranking(searchString, "FileUtils") -> 5 ranking(searchString, "FilenameUtils") -> 4 Computationally, the complexity is < N*M, where N : number of remaining entries, M : number of characters in the search string. a possible implementation: static int rank(String search, String entry) { int result = 0; for (int i = 0; i < search.length() && i < entry.length(); i++) { if (search.charAt(i) != entry.charAt(i)) { break; } result++; } return result; }