Bug 411015 - [code assist] Provide completion for org.foo.Bar.* when import static org.foo.Bar.X; is present
Summary: [code assist] Provide completion for org.foo.Bar.* when import static org.foo...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-18 09:04 EDT by Max Rydahl Andersen CLA
Modified: 2014-07-23 11:00 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max Rydahl Andersen CLA 2013-06-18 09:04:24 EDT
When you have:

package org.foo;

public class Bar {

	  public static final int X = 1;
	  public static final int THING = 2;
	  public static final int OTHER = 3;
}


package org.xyz;

import static org.foo.Bar.X;

public class Foo {

   int t = |
   
}

At | code completion will give me X (as expected) but would be nice in addition to see THING and OTHER as low priority items but easy to code complete on.

Once code completed it would add the proper import and be updated to:

package org.xyz;

import static org.foo.Bar.X;
import static org.foo.Bar.THING;


public class Foo {

   int t = THING;
   
}

and of course if you go beyond your import threshold it will turn into org.foo.Bar.*; eventually.
Comment 1 Dani Megert CLA 2013-06-21 09:20:23 EDT
Good idea. Should be doable.
Comment 2 ANIRBAN CHAKRABORTY CLA 2013-06-21 10:45:21 EDT
Currently I handle code assist. So, I'll take this one. Thanks
Comment 3 Stephan Herrmann CLA 2013-06-22 08:16:39 EDT
If you address this please also consider static methods, not only fields,
typical use case: import static org.junit.Assert.assertNotNull and then
you want to use other assert methods from the same class. 
Getting such proposals would be cool indeed.
Comment 4 ANIRBAN CHAKRABORTY CLA 2013-06-22 23:44:22 EDT
(In reply to comment #3)
> If you address this please also consider static methods, not only fields,
> typical use case: import static org.junit.Assert.assertNotNull and then
> you want to use other assert methods from the same class. 
> Getting such proposals would be cool indeed.

Sure Stephan. Thanks.