Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340795 - [content assist] Better ordering on the types being proposed
Summary: [content assist] Better ordering on the types being proposed
Status: CLOSED DUPLICATE of bug 261315
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-23 14:41 EDT by Pascal Rapicault CLA
Modified: 2011-04-12 05:35 EDT (History)
3 users (show)

See Also:


Attachments
screenshot of the problem (111.08 KB, image/png)
2011-03-23 14:41 EDT, Pascal Rapicault CLA
no flags Details
screenshot (51.02 KB, image/png)
2011-04-11 21:22 EDT, Deepak Azad CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2011-03-23 14:41:40 EDT
Created attachment 191780 [details]
screenshot of the problem

In the screenshot attached, I have a field whose type is known. 
When I try to create a new instance to assign it to this variable, I think the first types being proposed for completion should be those assignable to InputStream.
Comment 1 Dani Megert CLA 2011-03-24 05:08:26 EDT
This works in general. Maybe you've set the preference on Java > Editor > Content Assist to sort alphabetically? Maybe you use Mylyn which sorts differently?

Can you provide a reproducible code snippet?
Comment 2 Dani Megert CLA 2011-04-01 03:45:56 EDT
Ping.
Comment 3 Dani Megert CLA 2011-04-08 02:10:30 EDT
.
Comment 4 Deepak Azad CLA 2011-04-11 21:22:50 EDT
Created attachment 192994 [details]
screenshot

(In reply to comment #1)
> This works in general. 
hmm.. not really, see the screenshot.

--------------------------------------------
import java.io.InputStream;

class A {
	void foo() {
		InputStream is;
		is = new Byte<ctrl+space>
	}
}
--------------------------------------------

--------------------------------------------
import java.io.InputStream;

class A {
	void foo() {
		InputStream is;
		is = new File<ctrl+space>
	}
}
--------------------------------------------

In both cases the first type proposed cannot be assigned to InputStream.
Comment 5 Deepak Azad CLA 2011-04-11 21:23:46 EDT
Reopening.
Comment 6 Dani Megert CLA 2011-04-12 05:35:04 EDT
I see now. The problem was that I tried it in a class that already had some imports in that case those types are sorted on top.

Before we had constructor completion the sorting was improved using the LRU type cache but that's currently not yet implemented for the constructor proposal (see bug 261315).

That we fix the general case without LRU cache won't happen as it would be too expensive.

*** This bug has been marked as a duplicate of bug 261315 ***