Bug 177662

Summary: [content assist] Allow wildcard filtering of completion proposals
Product: [Eclipse Project] Platform Reporter: Felix Berger <bflat1>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, david_audel, laurenz.fiala
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Felix Berger CLA 2007-03-15 16:48:23 EDT
It would be very useful to search within the list of code completions using wildcards. A typical use case would be the completion list of methods that can be called on an object. These lists can be quite long and sometimes it is not clear if the name of a boolean getter is prefixed with "is" or "are" or nothing.

A wildcard search using * would be helpful.
Comment 1 Dani Megert CLA 2007-03-16 02:58:08 EDT
Moving to JDT Core for comments/investigation.
Comment 2 David Audel CLA 2007-03-16 05:34:29 EDT
What do you suggest exactly ?
Use wildcards directly in the editor?

eg.
class X {
   void getXMethod(){}
   void getYMethod(){}
   void getXFoo(){}
   void foo (X x) {
      get*Method| // do ctrl+space at |
   }
}
//then getXMethod and getYMethod are proposed

Or do ctrl+space and then type wildcards to filter proposed proposals ?

eg.
class X {
   void getXMethod(){}
   void getYMethod(){}
   void getXFoo(){}
   void foo (X x) {
      get| // do ctrl+space at |
   }
}
//then getXMethod, getYMethod and getXFoo are proposed. You type '*Method' and getXFoo is removed from the list of proposal.


The first possible behavior should be added in JDT Core but would be very hard to add Wildcard characters like * already means something in the java grammar. So in 'get*Method' * can be a multiply or a wildcard if the code is inside a method and is a syntax error outside a method. Add this behavior would require to modify deeply our completion parser.
So we won't add this kind of behavior for 3.3 and it won't be easy to add it in a future version.

The second possible behavior should be added in JDT Text and i don't know if it easier to implements.
Daniel, what do you think about this second possibility ?
Comment 3 Felix Berger CLA 2007-03-16 10:36:23 EDT
Thank you for the quick feedback!

I was thinking about the second use case, I would even popup the completion list on the object without any prefix sometimes and then use *Method to see all the methods that contain Method.

A good example would be the class "Class" that has:

getEnclosingMethod
getDeclaredMethod
getDeclaredMehtods

and more. 

Similar behavior as in the dialog you trigger with Ctrl-o.

Thanks,
Felix
Comment 4 David Audel CLA 2007-03-16 12:09:03 EDT
Moving to JDT Text
Comment 5 Dani Megert CLA 2014-10-22 11:42:40 EDT
*** Bug 448296 has been marked as a duplicate of this bug. ***